|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.foray.common.util.IntArrayBuilder
public class IntArrayBuilder
A resizable collection of primitive Integer.TYPE, a subset of what is available in StringBuilder,
but with ints instead of chars.
| Constructor Summary | |
|---|---|
IntArrayBuilder(int initialCapacity)
Constructor. |
|
| Method Summary | |
|---|---|
IntArrayBuilder |
append(int intToAppend)
Append an int to this structure. |
IntArrayBuilder |
delete(int start,
int end)
Removes the ints in a range of this sequence. |
IntArrayBuilder |
deleteIntAt(int index)
Removes the value at a given index. |
int |
intAt(int index)
|
int |
length()
|
IntArrayBuilder |
replace(int index,
int newValue)
Replaces the value at a given index with a new value. |
org.axsl.common.IntSequence |
subSequence(int start,
int end)
|
int[] |
toArray()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntArrayBuilder(int initialCapacity)
initialCapacity - The initial size of the internal array.| Method Detail |
|---|
public int length()
length in interface org.axsl.common.IntSequencepublic int intAt(int index)
intAt in interface org.axsl.common.IntSequence
public org.axsl.common.IntSequence subSequence(int start,
int end)
subSequence in interface org.axsl.common.IntSequencepublic int[] toArray()
toArray in interface org.axsl.common.IntSequencepublic String toString()
toString in class Objectpublic IntArrayBuilder append(int intToAppend)
intToAppend - The int to append.
public IntArrayBuilder replace(int index,
int newValue)
index - The index whose value should be replaced.newValue - The new value to place at index.
IndexOutOfBoundsException - If the index is negative or greater than or equal to length().public IntArrayBuilder deleteIntAt(int index)
index - The index whose value should be deleted.
IndexOutOfBoundsException - If the index is negative or greater than or equal to length().
public IntArrayBuilder delete(int start,
int end)
start and extends to the int at index end - 1 or to the end of
the sequence if no such int exists.
If start is equal to end, no changes are made.
start - The beginning index, inclusive.end - The ending index, exclusive.
IndexOutOfBoundsException - If start is negative, greater than length(), or greater than
end.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||