MCPcopy Index your code
hub / github.com/careercup/ctci / main

Method main

java/Chapter 16/Question16_4/Question.java:5–20  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

3public class Question {
4
5 public static void main(String[] args) {
6 int[] res1 = {1, 2, 3, 4};
7 int[] res2 = {1, 5, 4, 1};
8 int[] res3 = {1, 4, 5};
9
10 LockFactory.initialize(10);
11
12 LockFactory lf = LockFactory.getInstance();
13 System.out.println(lf.declare(1, res1));
14 System.out.println(lf.declare(2, res2));
15 System.out.println(lf.declare(3, res3));
16
17 System.out.println(lf.getLock(1, 1));
18 System.out.println(lf.getLock(1, 2));
19 System.out.println(lf.getLock(2, 4));
20 }
21
22}

Callers

nothing calls this directly

Calls 4

initializeMethod · 0.95
getInstanceMethod · 0.95
declareMethod · 0.95
getLockMethod · 0.95

Tested by

no test coverage detected