|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectweiss.util.AbstractCollection<AnyType>
weiss.util.ArrayList<AnyType>
public class ArrayList<AnyType>
The ArrayList implements a growable array. Insertions are always done at the end.
| Constructor Summary | |
|---|---|
ArrayList()
Construct an empty ArrayList. |
|
ArrayList(Collection<? extends AnyType> other)
Construct an ArrayList with same items as another Collection. |
|
| Method Summary | |
|---|---|
boolean |
add(AnyType x)
Adds an item to this collection, at the end. |
void |
clear()
Change the size of this collection to zero. |
boolean |
contains(java.lang.Object x)
Tests if some item is in this collection. |
AnyType |
get(int idx)
Returns the item at position idx. |
Iterator<AnyType> |
iterator()
Obtains an Iterator object used to traverse the collection. |
ListIterator<AnyType> |
listIterator(int idx)
Obtains a ListIterator object used to traverse the collection bidirectionally. |
AnyType |
remove(int idx)
Removes an item from this collection. |
boolean |
remove(java.lang.Object x)
Removes an item from this collection. |
AnyType |
set(int idx,
AnyType newVal)
Changes the item at position idx. |
int |
size()
Returns the number of items in this collection. |
ArrayList<AnyType> |
subList(int from,
int to)
|
| Methods inherited from class weiss.util.AbstractCollection |
|---|
equals, hashCode, isEmpty, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface weiss.util.Collection |
|---|
isEmpty, toArray, toArray |
| Constructor Detail |
|---|
public ArrayList()
public ArrayList(Collection<? extends AnyType> other)
| Method Detail |
|---|
public ArrayList<AnyType> subList(int from,
int to)
public int size()
size in interface Collection<AnyType>public AnyType get(int idx)
get in interface List<AnyType>idx - the index to search in.
java.lang.ArrayIndexOutOfBoundsException - if index is out of range.
public AnyType set(int idx,
AnyType newVal)
set in interface List<AnyType>idx - the index to change.newVal - the new value.
java.lang.ArrayIndexOutOfBoundsException - if index is out of range.public boolean contains(java.lang.Object x)
contains in interface Collection<AnyType>contains in class AbstractCollection<AnyType>x - any object.
public boolean add(AnyType x)
add in interface Collection<AnyType>add in class AbstractCollection<AnyType>x - any object.
public boolean remove(java.lang.Object x)
remove in interface Collection<AnyType>remove in class AbstractCollection<AnyType>x - any object.
public AnyType remove(int idx)
idx - the index of the object.
public void clear()
clear in interface Collection<AnyType>clear in class AbstractCollection<AnyType>public Iterator<AnyType> iterator()
iterator in interface java.lang.Iterable<AnyType>iterator in interface Collection<AnyType>public ListIterator<AnyType> listIterator(int idx)
listIterator in interface List<AnyType>idx - the index to start the iterator. Use size() to do complete
reverse traversal. Use 0 to do complete forward traversal.
java.lang.IndexOutOfBoundsException - if idx is not between 0 and size(), inclusive.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||