MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / add

Method add

lowlevel/CircularSet.java:19–23  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

17 Arrays.fill(array, -1);
18 }
19 public synchronized void add(int i) {
20 array[index] = i;
21 // Wrap index and write over old elements:
22 index = ++index % size;
23 }
24 public synchronized boolean contains(int val) {
25 for(int i = 0; i < size; i++)
26 if(array[i] == val) return true;

Callers 6

DelayedTaskMethod · 0.45
runMethod · 0.45
PrioritizedMethod · 0.45
runMethod · 0.45
fMethod · 0.45
gMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected