|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.base.Object
ist.palcom.base.LinkedList
public class LinkedList
LinkedList is a double linked list that supports the interface of both Java LinkedList and typical LinkedList datastructures in the Smalltalk world. The LinkedList class shares interface with the ArrayList class.
| Constructor Summary | |
|---|---|
LinkedList()
|
|
| Method Summary | |
|---|---|
void |
add(int index,
Object value)
Inserts the specified value at the specified position in this LinkedList. |
void |
add(Object value)
Adds the specified value after the last element of this LinkedList. |
void |
add(Object value,
Link link)
Adds the specified value before the specified link. |
void |
addFirst(Object value)
Adds the specified value before the first element of this LinkedList. |
void |
addLast(Object value)
Adds the specified value after the last element of this LinkedList. |
Array |
asArray()
Returns an array containing all elements in this LinkedList in the correct order. |
Object |
at(int index)
Returns the element at the specified position. |
void |
at(int index,
Object value)
Replaces the element at the specified position with the specified value. |
void |
clear()
Removes all elements from this LinkedList giving an empty list. |
boolean |
contains(Object value)
Tests if this LinkedList contains the specified value. |
Object |
getFirst()
Returns the first element of this LinkedList |
Object |
getLast()
Returns the last element of this LinkedList |
int |
indexOf(Object value)
Returns the index of the first occurrence of the specified value in this LinkedList. |
void |
init()
Initializes this LinkedList |
boolean |
isEmpty()
Tests if this LinkedList is empty. |
int |
lastIndexOf(Object value)
Returns the index of the last occurrence of the specified value in this LinkedList. |
Link |
link(int index)
Returns the link at specified index |
void |
remove(Object value)
Removes on instance of the specified value from this LinkedList. |
void |
removeAt(index index)
Removes the element at the specified position |
Object |
removeFirst()
Removes the first element of this LinkedList. |
Object |
removeLast()
Removes the last element of this LinkedList. |
void |
removeLink(Link link)
Removes the specified link from this LinkedList |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LinkedList()
| Method Detail |
|---|
public void removeAt(index index)
index - index of the element to remove.public void addLast(Object value)
value - Object the value to add after last element.
public void add(int index,
Object value)
index - int the position to insert at.value - Object the value to insert.public Object getFirst()
public void at(int index,
Object value)
index - int index of element to replacevalue - Object new value to store at specified positionpublic Object removeFirst()
public Object getLast()
public void add(Object value)
value - Object the value to add after last element.public void remove(Object value)
value - Object value to remove.public Array asArray()
public void add(Object value,
Link link)
value - Object the value to addlink - Link the link to add beforepublic boolean contains(Object value)
value - Object value to search for.
public void removeLink(Link link)
link - Link the link to removepublic int lastIndexOf(Object value)
value - Object the value to search for.
public boolean isEmpty()
public Object removeLast()
public void init()
public void addFirst(Object value)
value - Object the value to add before the first element..public void clear()
public Link link(int index)
index - int index of link to return.
public Object at(int index)
index - int index of element to return.
public int indexOf(Object value)
value - Object the value to search for.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||