public interface IntegerListInterface
How the list is physically stored is dependant on the implementation of the interface. An example of an implementation is 'BlockIntegerList'.
Modifier and Type | Method and Description |
---|---|
void |
add(int val)
Adds an int to the end of the list.
|
void |
add(int val,
int pos)
Adds an integet to the given position in the list.
|
boolean |
contains(int val)
Assuming the list is sorted, this performs a binary search and returns
true if the value is found, otherwise returns false.
|
boolean |
contains(Object key,
IndexComparator c)
Assuming the list is sorted, this performs a binary search and returns
true if the key value is found, otherwise returns false.
|
int |
get(int pos)
Returns the int at the given position (0 first, 1 second, etc) in the
list.
|
void |
insertSort(int val)
Inserts plain 'int' values into the list in sorted order.
|
void |
insertSort(Object key,
int val,
IndexComparator c)
Inserts the key/index pair into the list at the correct sorted position
(determine by the IndexComparator).
|
boolean |
isImmutable()
Returns true if this interface is immutable.
|
IntegerIterator |
iterator()
Returns an IntegerIterator that will walk from the start to the end
this list.
|
IntegerIterator |
iterator(int start_offset,
int end_offset)
Returns an IntegerIterator that will walk from the start offset
(inclusive) to the end offset (inclusive) of this list.
|
int |
remove(int pos)
Removes an int from the given position in the list.
|
boolean |
removeSort(int val)
Removes a plain 'int' value from the sorted position in the list only if
it's already in the list.
|
int |
removeSort(Object key,
int val,
IndexComparator c)
Removes the key/val pair from the list by first searching for it, and then
removing it from the list.
|
int |
searchFirst(Object key,
IndexComparator c)
Returns the index of the first value in this set that equals the given
value.
|
int |
searchLast(Object key,
IndexComparator c)
Returns the index of the last value in this set that equals the given
value.
|
void |
setImmutable()
Makes this list immutable effectively making it read-only.
|
int |
size()
The number of integers that are in the list.
|
boolean |
uniqueInsertSort(int val)
Inserts plain 'int' value into the sorted position in the list only if
it isn't already in the list.
|
void setImmutable()
Once 'setImmutable' is called, the list can not be changed back to being mutable.
boolean isImmutable()
int size()
int get(int pos)
void add(int val, int pos)
void add(int val)
int remove(int pos)
boolean contains(int val)
void insertSort(int val)
boolean uniqueInsertSort(int val)
boolean removeSort(int val)
boolean contains(Object key, IndexComparator c)
void insertSort(Object key, int val, IndexComparator c)
int removeSort(Object key, int val, IndexComparator c)
int searchLast(Object key, IndexComparator c)
int searchFirst(Object key, IndexComparator c)
IntegerIterator iterator(int start_offset, int end_offset)
IntegerIterator iterator()
Copyright © 2015. All rights reserved.