DEFAULTBLOC, size, sizeBloc, sorted
Constructor and Description |
---|
ShortArray(int bloc)
Create a free array of longs
|
ShortArray(short[] v)
Create an array of integers initializing with v[]
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(long v,
boolean testUnicity)
Add a long.
|
boolean |
add(short v,
boolean testUnicity) |
Array |
clone()
Deep copy
|
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 |
delete(short v) |
boolean |
delete(short v1,
short v2) |
boolean |
deleteBrothers(long me)
Delete three other brothers only of all of them are already present
(apart me)
|
boolean |
deleteBrothers(short me) |
boolean |
equals(Array a)
Equality test
|
int |
find(long v)
Return the index of the first value v.
|
int |
find(short v) |
int |
geSize() |
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(long vStart,
long vEnd)
Return true if at least one value of the range [vStart..vEnd] (included)
is found in the array
|
boolean |
intersectRange(short vStart,
short vEnd) |
short[] |
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 ShortArray(int bloc)
public ShortArray(short[] v)
v
- initial values of the arraypublic short[] seeArray()
public long get(int i)
Array
public void set(int i, long v)
Array
public int geSize()
public int getSizeCompressed()
getSizeCompressed
in class Array
public boolean add(long v, boolean testUnicity)
public boolean add(short v, boolean testUnicity)
public boolean delete(long v)
public boolean delete(short v)
public boolean delete(long v1, long v2)
public boolean delete(short v1, short v2)
public boolean deleteBrothers(long me)
deleteBrothers
in class Array
public boolean deleteBrothers(short me)
public int find(long v)
public int find(short v)
public boolean intersectRange(long vStart, long vEnd)
intersectRange
in class Array
vStart
- range starting valuevEnd
- range ending valuepublic boolean intersectRange(short vStart, short vEnd)