|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.util.leap.LinkedList
public class LinkedList
The LEAP (environment-dependent) version of the &qote;java.util.ArrayList&qote; class. This class appears to be exactly the same in J2SE, PJAVA and MIDP. The internal implementation is different in the three cases however.
LinkedList,
Serialized Form| Constructor Summary | |
|---|---|
LinkedList()
Default Constructor, creates an empty List |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object o)
Inserts the specified element at the specified position in this list |
boolean |
add(java.lang.Object o)
Adds an element. |
void |
addFirst(java.lang.Object o)
Inserts the given element at the beginning of this list. |
void |
addLast(java.lang.Object o)
Appends the given element to the end of this list. |
void |
clear()
Removes all of the elements from this list (optional operation). |
boolean |
contains(java.lang.Object o)
Returns true if this list contains the specified element. |
java.lang.Object |
get(int index)
Returns the element at the specified position in this list. |
int |
indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. |
boolean |
isEmpty()
Checks if the collection contains elements. |
Iterator |
iterator()
Returns an iterator over the elements in this collection. |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
remove(java.lang.Object o)
Removes one instance of the specified element. |
java.lang.Object |
removeFirst()
Removes and returns the first element from this list. |
int |
size()
Returns the number of elements in this collection. |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this collection. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LinkedList()
| Method Detail |
|---|
public void clear()
List
clear in interface Listinterfacepublic boolean contains(java.lang.Object o)
List
contains in interface Listo - element whose presence in this list is to be tested.
interfacepublic java.lang.Object get(int index)
List
get in interface Listindex - index of element to return.
interfacepublic int indexOf(java.lang.Object o)
List
indexOf in interface Listo - element to search for.
interfacepublic java.lang.Object remove(int index)
List
remove in interface Listindex - the index of the element to removed.
interfacepublic boolean add(java.lang.Object o)
Collection
add in interface Collectioninterface
public void add(int index,
java.lang.Object o)
add in interface Listpublic boolean isEmpty()
Collection
isEmpty in interface Collectioninterfacepublic boolean remove(java.lang.Object o)
Collection
remove in interface Collectiono - the element to be removed
interfacepublic java.lang.String toString()
toString in class java.lang.Objectpublic Iterator iterator()
Collection
iterator in interface Collectioninterfacepublic java.lang.Object[] toArray()
Collection
toArray in interface Collectioninterfacepublic int size()
Collection
size in interface Collectioninterfacepublic java.lang.Object removeFirst()
NoSuchElementException - if this list is empty.public void addFirst(java.lang.Object o)
o - the element to be inserted at the beginning of this list.public void addLast(java.lang.Object o)
o - the element to be inserted at the end of this list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||