public class RoundList extends java.lang.Object implements Serializable
Constructor and Description |
---|
RoundList()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Object element)
Inserts the
element before the current element. |
boolean |
contains(java.lang.Object element)
Returns true if this list contains the specified element.
|
java.lang.Object |
get()
Returns the current
element in the list and updates the pointer
such that the current becomes the
next element in the list. |
Iterator |
iterator()
Returns an Iterator over the elements in this list.
|
static void |
main(java.lang.String[] args)
Just for Debugging this implementation.
|
boolean |
remove(java.lang.Object element)
Removes the first occurrence of the specified element in this list
and updates the pointer to the current element.
|
int |
size()
Returns the number of elements in this list.
|
java.lang.Object[] |
toArray() |
java.lang.String |
toString()
Returns a string representation of this collection.
|
public boolean add(java.lang.Object element)
element
before the current element.
If the list was empty, the inserted element becomes also the current element.
Note that this implementation uses a LinkedList
and therefore it is not synchronized.element
- the element to insertpublic java.lang.Object get() throws java.util.NoSuchElementException
element
in the list and updates the pointer
such that the current becomes the
next element in the list.
size()
timesjava.util.NoSuchElementException
- if the list is emptypublic boolean remove(java.lang.Object element)
(element==null ? get(i)==null : element.equals(get(i)))
(if such an element exists).element
- the element to be removed from this list, if present.public boolean contains(java.lang.Object element)
(element==null ? e==null : element.equals(e)).
element
- whose presence in this list is to be tested.public int size()
public Iterator iterator()
public java.lang.Object[] toArray()
public java.lang.String toString()
String.valueOf(Object).
toString
in class java.lang.Object
public static void main(java.lang.String[] args)