|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<java.lang.Integer>
org.geotools.util.IntegerList
public class IntegerList
A list of unsigned integer values. This class packs the values in the minimal amount of bits required for storing unsigned integers of the given maximal value.
This class is not thread-safe. Synchronizations (if wanted) are user's reponsability.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
IntegerList(int initialCapacity,
int maximalValue)
Creates an initially empty list with the given initial capacity. |
|
IntegerList(int initialCapacity,
int maximalValue,
boolean fill)
Creates a new list with the given initial size. |
Method Summary | |
---|---|
boolean |
add(java.lang.Integer value)
Adds the given element to this list. |
void |
addInteger(int value)
Adds the given element as the int primitive type. |
void |
clear()
Discarts all elements in this list. |
IntegerList |
clone()
Returns a clone of this list. |
void |
fill(int value)
Fills the list with the given value. |
java.lang.Integer |
get(int index)
Returns the element at the given index. |
int |
getInteger(int index)
Returns the element at the given index as the int primitive type. |
int |
maximalValue()
Returns the maximal value that can be stored in this list. |
int |
occurence(int value)
Returns the occurence of the given value in this list. |
void |
resize(int size)
Sets the list size to the given value. |
java.lang.Integer |
set(int index,
java.lang.Integer value)
Sets the element at the given index. |
void |
setInteger(int index,
int value)
Sets the element at the given index as the int primitive type. |
int |
size()
Returns the current number of values in this list. |
void |
trimToSize()
Trims the capacity of this list to be its current size. |
Methods inherited from class java.util.AbstractList |
---|
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public IntegerList(int initialCapacity, int maximalValue)
initialCapacity
- The initial capacity.maximalValue
- The maximal value to be allowed, inclusive.public IntegerList(int initialCapacity, int maximalValue, boolean fill)
initialCapacity
- The initial capacity.maximalValue
- The maximal value to be allowed, inclusive.fill
- If true
, the initial size is set to the initial
capacity with all values set to 0.Method Detail |
---|
public int maximalValue()
public int size()
size
in interface java.util.Collection<java.lang.Integer>
size
in interface java.util.List<java.lang.Integer>
size
in class java.util.AbstractCollection<java.lang.Integer>
public void resize(int size)
size
- The new size.public void fill(int value)
size
exclusive.
value
- The value to set.public void clear()
clear
in interface java.util.Collection<java.lang.Integer>
clear
in interface java.util.List<java.lang.Integer>
clear
in class java.util.AbstractList<java.lang.Integer>
public boolean add(java.lang.Integer value) throws java.lang.IllegalArgumentException
add
in interface java.util.Collection<java.lang.Integer>
add
in interface java.util.List<java.lang.Integer>
add
in class java.util.AbstractList<java.lang.Integer>
value
- The value to add.
java.lang.NullPointerException
- if the given value is null.
java.lang.IllegalArgumentException
- if the given value is out of bounds.public void addInteger(int value) throws java.lang.IllegalArgumentException
int
primitive type.
value
- The value to add.
java.lang.IllegalArgumentException
- if the given value is out of bounds.public java.lang.Integer get(int index) throws java.lang.IndexOutOfBoundsException
get
in interface java.util.List<java.lang.Integer>
get
in class java.util.AbstractList<java.lang.Integer>
index
- The element index.
java.lang.IndexOutOfBoundsException
- if the given index is out of bounds.public int getInteger(int index) throws java.lang.IndexOutOfBoundsException
int
primitive type.
index
- The element index.
java.lang.IndexOutOfBoundsException
- if the given index is out of bounds.public java.lang.Integer set(int index, java.lang.Integer value) throws java.lang.IndexOutOfBoundsException
set
in interface java.util.List<java.lang.Integer>
set
in class java.util.AbstractList<java.lang.Integer>
index
- The element index.value
- The value at the given index.
java.lang.IndexOutOfBoundsException
- if the given index is out of bounds.
java.lang.IllegalArgumentException
- if the given value is out of bounds.
java.lang.NullPointerException
- if the given value is null.public void setInteger(int index, int value) throws java.lang.IndexOutOfBoundsException
int
primitive type.
index
- The element index.value
- The value at the given index.
java.lang.IndexOutOfBoundsException
- if the given index is out of bounds.
java.lang.IllegalArgumentException
- if the given value is out of bounds.public int occurence(int value)
value
- The value to search for.
public void trimToSize()
public IntegerList clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |