|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.plt.iter.AbstractIterable<T>
edu.rice.cs.plt.collect.ConsList<T>
edu.rice.cs.plt.collect.ConsList.Nonempty<T>
public static class ConsList.Nonempty<T>
The nonempty variant of a ConsList. Contains a first value of the element
type and a rest which is another list.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class edu.rice.cs.plt.collect.ConsList |
|---|
ConsList.Empty<T>, ConsList.Nonempty<T> |
| Constructor Summary | |
|---|---|
ConsList.Nonempty(T first,
ConsList<? extends T> rest)
|
|
| Method Summary | ||
|---|---|---|
|
apply(ConsVisitor<? super T,? extends Ret> visitor)
Invoke the forNonempty case of a visitor |
|
T |
first()
|
|
boolean |
isEmpty()
Return false. |
|
Iterator<T> |
iterator()
Create an iterator to traverse the list |
|
ConsList<? extends T> |
rest()
|
|
int |
size()
Return 1 + rest.size(). |
|
int |
size(int bound)
Return 1 + rest.size(bound - 1), or 0 if bound == 0. |
|
| Methods inherited from class edu.rice.cs.plt.collect.ConsList |
|---|
append, compositeHeight, compositeSize, cons, empty, filter, first, hasFixedSize, isInfinite, isStatic, map, rest, reverse, singleton |
| Methods inherited from class edu.rice.cs.plt.iter.AbstractIterable |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConsList.Nonempty(T first,
ConsList<? extends T> rest)
| Method Detail |
|---|
public T first()
public ConsList<? extends T> rest()
public <Ret> Ret apply(ConsVisitor<? super T,? extends Ret> visitor)
forNonempty case of a visitor
apply in class ConsList<T>public Iterator<T> iterator()
iterator in interface Iterable<T>iterator in class ConsList<T>public boolean isEmpty()
false.
isEmpty in interface SizedIterable<T>isEmpty in class ConsList<T>public int size()
1 + rest.size().
size in interface SizedIterable<T>size in class ConsList<T>public int size(int bound)
1 + rest.size(bound - 1), or 0 if bound == 0.
size in interface SizedIterable<T>size in class ConsList<T>bound - Maximum result. Assumed to be nonnegative.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||