|
APCS Java Subset | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An ordered sequence or collection. In the AB course
students will be expected to understand that
ArrayList and LinkedList both
implement the List interface. The
List interface is only used in the AB course.
| Method Summary | |
boolean |
add(java.lang.Object x)
Append (adds) the argument to the end of this list. |
java.lang.Object |
get(int index)
Returns the element at the specified position in this list. |
Iterator |
iterator()
Returns an iterator over the elements in this list. |
ListIterator |
listIterator()
Returns a list iterator over the elements in this list. |
java.lang.Object |
set(int index,
java.lang.Object o)
Replaces the element at the specified position in this list with the specified object. |
int |
size()
|
| Methods inherited from interface java.util.Collection |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Method Detail |
public boolean add(java.lang.Object x)
add in interface java.util.Collectionx - is the element appended to this list.
public java.lang.Object get(int index)
index - is the position of the element returned
java.lang.IndexOutOfBoundsException - if index < 0 || index >=
size()
public java.lang.Object set(int index,
java.lang.Object o)
index - is the position of the element that will be
replacedo - is the object to be stored at the specified position
java.lang.IndexOutOfBoundsException - if index < 0 || index >=
size() public int size()
size in interface java.util.Collectionpublic Iterator iterator()
next() first the
element with index zero/0.
iterator in interface java.util.Collectionpublic ListIterator listIterator()
next() first the
element with index zero/0.
|
unofficial documentation for the APCS Java Subset | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||