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.
|
hasChanged
protected 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 IntegerListBlockInterface
public final boolean isFull()
isFull
in class IntegerListBlockInterface
public final boolean isEmpty()
isEmpty
in class IntegerListBlockInterface
public final boolean canContain(int number)
canContain
in class IntegerListBlockInterface
public int topInt()
topInt
in class IntegerListBlockInterface
public int bottomInt()
bottomInt
in class IntegerListBlockInterface
public final int intAt(int pos)
intAt
in class IntegerListBlockInterface
public final void addInt(int val)
addInt
in class IntegerListBlockInterface
public final int removeIntAt(int pos)
removeIntAt
in class IntegerListBlockInterface
public final void insertIntAt(int val, int pos)
insertIntAt
in class IntegerListBlockInterface
public final int setIntAt(int val, int pos)
setIntAt
in class IntegerListBlockInterface
public final void moveTo(IntegerListBlockInterface dest_block, int dest_index, int length)
moveTo
in class IntegerListBlockInterface
public final void copyTo(IntegerListBlockInterface dest_block)
copyTo
in class IntegerListBlockInterface
public final int copyTo(int[] to, int offset)
copyTo
in class IntegerListBlockInterface
public final void clear()
clear
in class IntegerListBlockInterface
public int iterativeSearch(int val)
iterativeSearch
in class IntegerListBlockInterface
public int iterativeSearch(int val, int position)
iterativeSearch
in class IntegerListBlockInterface
public final int binarySearch(Object key, IndexComparator c)
binarySearch
in class IntegerListBlockInterface
public final int searchFirst(Object key, IndexComparator c)
searchFirst
in class IntegerListBlockInterface
public final int searchLast(Object key, IndexComparator c)
searchLast
in class IntegerListBlockInterface
public final int searchFirst(int val)
searchFirst
in class IntegerListBlockInterface
public final int searchLast(int val)
searchLast
in class IntegerListBlockInterface
Copyright © 2015. All rights reserved.