|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.util.IndexList
A general-purpose List, in which objects keep their identity (index), that is, insert() operations do not renumber remaining objects. Hence, more like a real array than an ArrayList is(!).
Not necessarily for production use; written as an example of implementing the List interface.
Field Summary | |
static int |
DEFAULT_START_SIZE
The initial size of an instance's internal store |
Constructor Summary | |
IndexList()
|
|
IndexList(int startSize)
|
Method Summary | |
void |
add(int i,
java.lang.Object o)
Unlike the general contract of List, this will replace, not insert before, the object at the given index. |
boolean |
add(java.lang.Object o)
Add the given object to the end of the list |
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int i,
java.util.Collection c)
|
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
void |
ensureCapacity(int i)
|
java.lang.Object |
get(int i)
|
int |
hashCode()
|
int |
indexOf(java.lang.Object o)
Find the location where this object is referenced, or null |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
int |
lastIndexOf(java.lang.Object o)
|
java.util.ListIterator |
listIterator()
|
java.util.ListIterator |
listIterator(int i)
|
java.lang.Object |
remove(int i)
remove() simply sets the given value to null. |
boolean |
remove(java.lang.Object o)
remove() simply sets the given value to null. |
boolean |
removeAll(java.util.Collection c)
removeAll removes all the elements in a Collection from this List NOT IMPLEMENTED. |
boolean |
retainAll(java.util.Collection c)
|
java.lang.Object |
set(int i,
java.lang.Object o)
|
int |
size()
|
java.util.List |
subList(int from,
int to)
|
java.lang.Object[] |
toArray()
Return the collection as an Array of Object |
java.lang.Object[] |
toArray(java.lang.Object[] newData)
Return the collection as an Array of newData's type |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
equals |
Field Detail |
public static final int DEFAULT_START_SIZE
Constructor Detail |
public IndexList()
public IndexList(int startSize)
Method Detail |
public void ensureCapacity(int i)
public int size()
size
in interface java.util.List
public boolean isEmpty()
isEmpty
in interface java.util.List
public boolean contains(java.lang.Object o)
contains
in interface java.util.List
public boolean add(java.lang.Object o)
add
in interface java.util.List
public boolean remove(java.lang.Object o)
remove
in interface java.util.List
public java.lang.Object remove(int i)
remove
in interface java.util.List
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.List
public java.util.Iterator iterator()
iterator
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] newData)
toArray
in interface java.util.List
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.List
public boolean addAll(int i, java.util.Collection c)
addAll
in interface java.util.List
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.List
public void clear()
clear
in interface java.util.List
public int hashCode()
hashCode
in interface java.util.List
public java.lang.Object get(int i)
get
in interface java.util.List
public java.lang.Object set(int i, java.lang.Object o)
set
in interface java.util.List
public void add(int i, java.lang.Object o)
add
in interface java.util.List
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int i)
listIterator
in interface java.util.List
public java.util.List subList(int from, int to)
subList
in interface java.util.List
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |