|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.list.List<E>
E
- the underlying Node parameterizationpublic class List<E>
List of objects.
Constructor Summary | |
---|---|
List()
Construct an empty list. |
Method Summary | |
---|---|
void |
append(E e)
Append element to the end of the list. |
void |
concat(List<E> list)
Concatenate a list to the end of our list. |
E |
contains(E e)
Determine membership by returning element if found. |
Node<E> |
head()
Return head of the list. |
boolean |
isEmpty()
Return whether the list is empty. |
java.util.Iterator<E> |
iterator()
Return iterator over the list. |
E |
remove()
Remove element from the front of the list and return it. |
int |
size()
Return size of the list. |
java.lang.String |
toString()
Useful string for debugging. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public List()
Method Detail |
---|
public boolean isEmpty()
public int size()
public Node<E> head()
public void append(E e)
e
- element to be appended.public E contains(E e)
We return the object in the list, rather than boolean, since complex objects that meet 'equals' may, in fact, contain additional information and the external code might want to have the actual object in the list.
e
- sought for object.public E remove()
java.util.NoSuchElementException
- if list is empty.public void concat(List<E> list)
If list is null, then no operation (or error) occurs. Note that concatenating list A to B does not affect the passed in list parameter. Thus you may end up with some interesting intermingled objects if you are not careful.
list
- List to be concatenated to the end of the list.public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |