public static class BlockIntegerList.IntArrayListBlock extends IntegerListBlockInterface
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
array
The array of int's stored in this block.
|
protected int |
count
The number of block entries in this list.
|
next, previous| Modifier | Constructor and Description |
|---|---|
protected |
IntArrayListBlock()
Blank protected constructor.
|
|
IntArrayListBlock(int block_size)
Constructs the block to a specific size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInt(int val)
Adds an int to the block.
|
int |
binarySearch(Object key,
IndexComparator c)
Considers each int a reference to another structure, and the block
sorted by these structures.
|
int |
bottomInt()
The bottom int in the list.
|
boolean |
canContain(int number)
Returns true if the block has enough room to fill with the given number
of integers.
|
void |
clear()
Clears the object to be re-used.
|
int |
copyTo(int[] to,
int offset)
Copies all the data from this block into the given int[] array.
|
void |
copyTo(IntegerListBlockInterface dest_block)
Copies all the data from this block into the given destination block.
|
protected int[] |
getArray(boolean immutable)
Returns the int[] array for this block.
|
protected int |
getArrayLength()
Returns the count of int's in this block.
|
void |
insertIntAt(int val,
int pos)
Inserts an int at the given position.
|
int |
intAt(int pos)
Returns the int at the given position in the array.
|
boolean |
isEmpty()
Returns true if the block is empty.
|
boolean |
isFull()
Returns true if the block is full.
|
int |
iterativeSearch(int val)
Performs an iterative search through the int values in the list.
|
int |
iterativeSearch(int val,
int position)
Performs an iterative search from the given position to the end of
the list in the block.
|
void |
moveTo(IntegerListBlockInterface dest_block,
int dest_index,
int length)
Moves a set of values from the end of this block and inserts it into the
given block at the destination index specified.
|
int |
removeIntAt(int pos)
Removes an Int from the specified position in the block.
|
int |
searchFirst(int val)
Assuming a sorted block, finds the first index in the block that
equals the given value.
|
int |
searchFirst(Object key,
IndexComparator c)
Considers each int a reference to another structure, and the block
sorted by these structures.
|
int |
searchLast(int val)
Assuming a sorted block, finds the first index in the block that
equals the given value.
|
int |
searchLast(Object key,
IndexComparator c)
Considers each int a reference to another structure, and the block
sorted by these structures.
|
int |
setIntAt(int val,
int pos)
Sets an int at the given position, overwriting anything that was
previously there.
|
int |
size()
Returns the number of entries in this block.
|
int |
topInt()
The top int in the list.
|
String |
toString()
Converts the block into a String.
|
hasChangedprotected int[] array
protected int count
protected IntArrayListBlock()
public IntArrayListBlock(int block_size)
protected int[] getArray(boolean immutable)
protected int getArrayLength()
public final int size()
size in class IntegerListBlockInterfacepublic final boolean isFull()
isFull in class IntegerListBlockInterfacepublic final boolean isEmpty()
isEmpty in class IntegerListBlockInterfacepublic final boolean canContain(int number)
canContain in class IntegerListBlockInterfacepublic int topInt()
topInt in class IntegerListBlockInterfacepublic int bottomInt()
bottomInt in class IntegerListBlockInterfacepublic final int intAt(int pos)
intAt in class IntegerListBlockInterfacepublic final void addInt(int val)
addInt in class IntegerListBlockInterfacepublic final int removeIntAt(int pos)
removeIntAt in class IntegerListBlockInterfacepublic final void insertIntAt(int val,
int pos)
insertIntAt in class IntegerListBlockInterfacepublic final int setIntAt(int val,
int pos)
setIntAt in class IntegerListBlockInterfacepublic final void moveTo(IntegerListBlockInterface dest_block, int dest_index, int length)
moveTo in class IntegerListBlockInterfacepublic final void copyTo(IntegerListBlockInterface dest_block)
copyTo in class IntegerListBlockInterfacepublic final int copyTo(int[] to,
int offset)
copyTo in class IntegerListBlockInterfacepublic final void clear()
clear in class IntegerListBlockInterfacepublic int iterativeSearch(int val)
iterativeSearch in class IntegerListBlockInterfacepublic int iterativeSearch(int val,
int position)
iterativeSearch in class IntegerListBlockInterfacepublic final int binarySearch(Object key, IndexComparator c)
binarySearch in class IntegerListBlockInterfacepublic final int searchFirst(Object key, IndexComparator c)
searchFirst in class IntegerListBlockInterfacepublic final int searchLast(Object key, IndexComparator c)
searchLast in class IntegerListBlockInterfacepublic final int searchFirst(int val)
searchFirst in class IntegerListBlockInterfacepublic final int searchLast(int val)
searchLast in class IntegerListBlockInterfaceCopyright © 2016. All rights reserved.