|
Colt 1.2.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
cern.colt.list.adapter.IntListAdapter
public class IntListAdapter
Adapter that permits an AbstractIntList
to be viewed and treated as a JDK 1.2 AbstractList
.
Makes the contained list compatible with the JDK 1.2 Collections Framework.
Any attempt to pass elements other than java.lang.Number to setter methods will throw a java.lang.ClassCastException. java.lang.Number.intValue() is used to convert objects into primitive values which are then stored in the backing templated list. Getter methods return java.lang.Integer objects.
Field Summary | |
---|---|
protected AbstractIntList |
content
|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
IntListAdapter(AbstractIntList content)
Constructs a list backed by the specified content list. |
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object element)
Inserts the specified element at the specified position in this list (optional operation). |
java.lang.Object |
get(int index)
Returns the element at the specified position in this list. |
protected static java.lang.Object |
object(int element)
Transforms an element of a primitive data type to an object. |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list (optional operation). |
java.lang.Object |
set(int index,
java.lang.Object element)
Replaces the element at the specified position in this list with the specified element (optional operation). |
int |
size()
Returns the number of elements in this list. |
protected static int |
value(java.lang.Object element)
Transforms an object element to a primitive data type. |
Methods inherited from class java.util.AbstractList |
---|
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, 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 |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, subList, toArray, toArray |
Field Detail |
---|
protected AbstractIntList content
Constructor Detail |
---|
public IntListAdapter(AbstractIntList content)
Method Detail |
---|
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.AbstractList
index
- index at which the specified element is to be inserted.element
- element to be inserted.
java.lang.ClassCastException
- if the class of the specified element
prevents it from being added to this list.
java.lang.IllegalArgumentException
- if some aspect of the specified
element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException
- index is out of range (index <
0 || index > size()).public java.lang.Object get(int index)
get
in interface java.util.List
get
in class java.util.AbstractList
index
- index of element to return.
java.lang.IndexOutOfBoundsException
- if the given index is out of range
(index < 0 || index >= size()).protected static java.lang.Object object(int element)
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.AbstractList
index
- the index of the element to remove.
java.lang.IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index >= size()).public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.AbstractList
index
- index of element to replace.element
- element to be stored at the specified position.
java.lang.ClassCastException
- if the class of the specified element
prevents it from being added to this list.
java.lang.IllegalArgumentException
- if some aspect of the specified
element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index >= size()).public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in class java.util.AbstractCollection
protected static int value(java.lang.Object element)
|
Colt 1.2.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |