|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.LinkedListInt
A simple linkedlist class for the fundamental type int.
The iterators will throw the runtime-exception
ListModifiedException in case they detect themselves
that they were modified since the iterator was instantiated. This is
NOT RELIABLE in the context of a multithreaded
application. Only proper synchronization provides memory-barriers in
the java programming language. Thus this is merely a helpful technique
that might detect errors in concurrent programming. Only in a serialized
programming context, the programmer can rely on the exception being
generated each time the array is illegaly modified.
| Nested Class Summary | |
class |
LinkedListInt.Iterator
LinkedList iterator class |
| Constructor Summary | |
LinkedListInt()
Constructs an empty linked list. |
|
| Method Summary | |
boolean |
add(int value)
Adds an element with given value to the end of the list |
boolean |
addFirst(int value)
Adds an element with given value before the beginning of the list. |
boolean |
addLast(int value)
Adds an element with given value to the end of the list |
int |
getFirst()
Returns the first element from the list. |
int |
getLast()
Returns the last element from the list. |
int |
indexOf(int value)
Searches a value's position in the list. |
LinkedListInt.Iterator |
iterator()
Returns an iterator for this list |
boolean |
remove(int value)
Removes the specified element. |
int |
removeFirst()
Removes an element from the beginning of the list. |
int |
removeLast()
Removes an element from the end of the list. |
int |
size()
Gets the size of the list. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LinkedListInt()
| Method Detail |
public final int size()
public final int getFirst()
IllegalElementException - if the list is the empty listpublic final int getLast()
IllegalElementException - if the list is the empty listpublic final boolean addFirst(int value)
value - the value of the element to add to the list.
true. This is to keep consistent with
standard classes from standard librarypublic final boolean addLast(int value)
value - the value of the element to add to the list.
true. this is to keep consistent with
standard classes from standard librarypublic final int removeFirst()
public final int removeLast()
public boolean remove(int value)
value - the value whose first occurence is to be removed.
public final boolean add(int value)
value - the value of the element to add to the list.
true. This is to keep consistent with
standard classes from standard librarypublic LinkedListInt.Iterator iterator()
public int indexOf(int value)
value - the value to search
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||