|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.util.IndexList<T>
public class IndexList<T>
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,
T o)
Unlike the general contract of List, this will replace, not insert before, the object at the given index. |
boolean |
add(T 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)
|
T |
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<T> |
iterator()
|
int |
lastIndexOf(java.lang.Object o)
|
java.util.ListIterator<T> |
listIterator()
|
java.util.ListIterator<T> |
listIterator(int i)
|
T |
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)
|
T |
set(int i,
T o)
|
int |
size()
|
java.util.List<T> |
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.Collection<T>
size
in interface java.util.List<T>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<T>
isEmpty
in interface java.util.List<T>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<T>
contains
in interface java.util.List<T>
public boolean add(T o)
add
in interface java.util.Collection<T>
add
in interface java.util.List<T>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<T>
remove
in interface java.util.List<T>
public T remove(int i)
remove
in interface java.util.List<T>
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection<T>
removeAll
in interface java.util.List<T>
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
iterator
in interface java.util.Collection<T>
iterator
in interface java.util.List<T>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<T>
toArray
in interface java.util.List<T>
public java.lang.Object[] toArray(java.lang.Object[] newData)
toArray
in interface java.util.Collection<T>
toArray
in interface java.util.List<T>
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection<T>
containsAll
in interface java.util.List<T>
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection<T>
addAll
in interface java.util.List<T>
public boolean addAll(int i, java.util.Collection c)
addAll
in interface java.util.List<T>
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection<T>
retainAll
in interface java.util.List<T>
public void clear()
clear
in interface java.util.Collection<T>
clear
in interface java.util.List<T>
public int hashCode()
hashCode
in interface java.util.Collection<T>
hashCode
in interface java.util.List<T>
hashCode
in class java.lang.Object
public T get(int i)
get
in interface java.util.List<T>
public T set(int i, T o)
set
in interface java.util.List<T>
public void add(int i, T o)
add
in interface java.util.List<T>
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<T>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator()
listIterator
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator(int i)
listIterator
in interface java.util.List<T>
public java.util.List<T> subList(int from, int to)
subList
in interface java.util.List<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |