DEFAULTBLOC, size, sizeBloc, sorted
Constructor and Description |
---|
IntArray(int bloc)
Create a free array of longs
|
IntArray(int[] v)
Create an array of integers initializing with v[]
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int v,
boolean testUnicity) |
boolean |
add(long v,
boolean testUnicity)
Add a long.
|
Array |
clone()
Deep copy
|
boolean |
delete(int v) |
boolean |
delete(int v1,
int v2) |
boolean |
delete(long v)
Delete the first value equals to v
kept the array sorted if required
|
boolean |
delete(long v1,
long v2)
Delete the all values between v1 and v2 (inclusive)
kept the array sorted if required
|
boolean |
deleteBrothers(int me) |
boolean |
deleteBrothers(long me)
Delete three other brothers only of all of them are already present
(apart me)
|
boolean |
equals(Array a)
Equality test
|
int |
find(int v) |
int |
find(long v)
Return the index of the first value v.
|
long |
get(int i)
Provide the element i
|
long |
getMem()
Size of the array in bytes
|
int |
getSizeCompressed()
Size of the array in compressed mode
=> consecutive values are memorized as range (2 values)
|
boolean |
intersectRange(int vStart,
int vEnd) |
boolean |
intersectRange(long vStart,
long vEnd)
Return true if at least one value of the range [vStart..vEnd] (included)
is found in the array
|
int[] |
seeArray()
Provide the java reference on the array
(real size is provided by getSize() and not by .length)
|
void |
set(int i,
long v)
set the element i
|
void |
sort()
Sort the array (only if required)
|
void |
trim()
Remove the reservation room in the array
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public IntArray(int bloc)
public IntArray(int[] v)
v
- initial values of the arraypublic int[] seeArray()
public long get(int i)
Array
public void set(int i, long v)
Array
public int getSizeCompressed()
getSizeCompressed
in class Array
public boolean add(long v, boolean testUnicity)
public boolean add(int v, boolean testUnicity)
public boolean delete(long v)
public boolean delete(int v)
public boolean delete(long v1, long v2)
public boolean delete(int v1, int v2)
public boolean deleteBrothers(long me)
deleteBrothers
in class Array
public boolean deleteBrothers(int me)
public int find(long v)
public int find(int v)
public boolean intersectRange(long vStart, long vEnd)
intersectRange
in class Array
vStart
- range starting valuevEnd
- range ending valuepublic boolean intersectRange(int vStart, int vEnd)