| Modifier and Type | Method and Description |
|---|---|
CList<V> |
cons(V element)
Add an element to the head of the list.
|
boolean |
contains(V element)
Test for element.
|
V |
head()
Get the head of the list.
|
Iterator<V> |
iterator()
Iterate through the elements in the list.
|
CList<V> |
tail()
Get the rest of the list after the head.
|
void |
toCollection(Collection<V> collection)
Copy elements in list to collection in order.
|
boolean |
visit(ConditionalVisitor<V> visitor)
Visit each element in order until visit returns false.
|
void |
visit(Visitor<V> visitor)
Visit each element in order.
|
isEmpty, reverseIterator, reverseVisit, reverseVisit, sizestatic final Nil NIL
CList<V> cons(V element)
element - boolean contains(V element)
V head()
CList<V> tail()
getFirst/getRest are not the most efficient
way to traverse the list elements.iterator()Iterator<V> iterator()
boolean visit(ConditionalVisitor<V> visitor)
If the list is empty, returns true.
void toCollection(Collection<V> collection)
collection - Copyright © 2015. All rights reserved.