universe
Class Cons<X>

java.lang.Object
  extended by universe.List<X>
      extended by universe.Cons<X>
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<X>

public class Cons<X>
extends List<X>

Represents a Lisp style cons list. You should not use the constructor, use List.push(...) to add an element to the front of the list. It is left public so that the parser generator can parse different lists if needed.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class universe.List
List.Build<X>, List.Comp<X>, List.Fold<X,Y>, List.GComp<X,Y>, List.Map<X,Y>, List.Pred<X>, List.Stringer<X>, List.Zip<X,Y,Z>
 
Constructor Summary
Cons(X f, List<X> r)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Equals for Lists...
 X getFirst()
          Getter for Entry.key
 List<X> getRest()
          Getter for Entry.val
 int hashCode()
          HashCode for Lists...
 boolean isEmpty()
          Is this List Empty?
 List<X> pop()
          Return this List without the first Element
 X top()
          Return the first Element of this List
 
Methods inherited from class universe.List
add, andmap, append, append, buildlist, contains, contains, containsAll, containsAll, containsAllG, containsAny, containsAny, containsAnyG, containsG, count, create, create, create, create, create, filter, filter, filterout, filterout, find, find, findG, fold, foldl, foldr, index, index, insert, insert, insertionSort, iterator, length, lookup, main, map, ormap, pop, push, push, remove, remove, remove, removeDuplicates, removeDuplicates, removeG, replace, replace, replace, replaceAll, replaceAll, reverse, reverse, same, same, sameG, shuffle, sort, sublist, toArray, toJavaList, toString, toString, toString, zip
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cons

public Cons(X f,
            List<X> r)
Method Detail

top

public X top()
Description copied from class: List
Return the first Element of this List

Specified by:
top in class List<X>

pop

public List<X> pop()
Description copied from class: List
Return this List without the first Element

Specified by:
pop in class List<X>

isEmpty

public boolean isEmpty()
Description copied from class: List
Is this List Empty?

Specified by:
isEmpty in class List<X>

equals

public boolean equals(java.lang.Object o)
Description copied from class: List
Equals for Lists...

Specified by:
equals in class List<X>

hashCode

public int hashCode()
Description copied from class: List
HashCode for Lists...

Specified by:
hashCode in class List<X>

getFirst

public X getFirst()
Getter for Entry.key


getRest

public List<X> getRest()
Getter for Entry.val