|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.util.IntArray
public class IntArray
An array with integer element.
| Constructor Summary | |
|---|---|
IntArray()
Create an int array with the default initial capacity. |
|
IntArray(int capacity)
Create an int array with specified initial capacity. |
|
IntArray(int[] data)
Create an int array with the given values and size. |
|
| Method Summary | |
|---|---|
void |
add(int value)
Append a value. |
void |
add(int index,
int value)
Insert an element at the given position. |
void |
addValueSorted(int value)
Insert an element at the correct position in a sorted list. |
boolean |
equals(java.lang.Object obj)
|
int |
findIndexSorted(int value)
Return the index with a this value. |
int |
findNextIndexSorted(int value)
Return the next index with a value larger than this one. |
int |
get(int index)
Get the value at the given index. |
int |
hashCode()
|
void |
remove(int index)
Remove the value at the given index. |
void |
removeAllSorted(IntArray removeSorted)
Remove all values from the given sorted list from this sorted list. |
void |
removeLastValue(int value)
Remove the last element of this list that matches this value. |
void |
removeRange(int fromIndex,
int toIndex)
Remove a number of elements. |
void |
removeValue(int value)
Remove the first element of this list that matches this value. |
void |
set(int index,
int value)
Update the value at the given index. |
int |
size()
Get the size of the list. |
void |
sort()
Sort the array by value. |
void |
toArray(int[] array)
Convert this list to an array. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntArray()
public IntArray(int capacity)
capacity - the initial capacitypublic IntArray(int[] data)
data - the int array| Method Detail |
|---|
public void add(int value)
value - the value to appendpublic int get(int index)
index - the index
public void remove(int index)
index - the index
public void add(int index,
int value)
index - the index where to insert the valuevalue - the value to insert
public void set(int index,
int value)
index - the indexvalue - the new valuepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int size()
public void addValueSorted(int value)
value - the value to insertpublic void removeValue(int value)
value - the value to be removepublic void removeLastValue(int value)
value - the value to be removepublic int findIndexSorted(int value)
value - the value to find
public int findNextIndexSorted(int value)
value - the value to find
public void sort()
public void toArray(int[] array)
array - the target arraypublic void removeAllSorted(IntArray removeSorted)
removeSorted - the value to removepublic java.lang.String toString()
toString in class java.lang.Object
public void removeRange(int fromIndex,
int toIndex)
fromIndex - the index of the first item to removetoIndex - upper bound (exclusive)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||