orc.runtime.values
Class ConsValue<E>

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.values.ListValue<E>
          extended by orc.runtime.values.ConsValue<E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, Eq, ListLike

public class ConsValue<E>
extends ListValue<E>


Field Summary
 E head
           
 ListValue<E> tail
           
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Constructor Summary
ConsValue(E h, ListValue<E> t)
           
 
Method Summary
<T> T
accept(Visitor<T> visitor)
           
 boolean contains(java.lang.Object o)
           
 java.util.List<E> enlist()
           
 boolean eqTo(java.lang.Object that_)
          Return true if this is equivalent to that.
 boolean equals(java.lang.Object that)
           
 int hashCode()
           
 boolean isEmpty()
           
 int size()
           
 java.lang.String toString()
           
 void uncons(Token caller)
          Return the head and tail of a cons-like data structure to a token, or die.
 void unnil(Token caller)
          Signal a token if this value is equivalent to nil, or die.
 
Methods inherited from class orc.runtime.values.ListValue
add, addAll, clear, containsAll, iterator, make, make, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class orc.runtime.values.Value
forceArg, forceCall, signal, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

head

public E head

tail

public ListValue<E> tail
Constructor Detail

ConsValue

public ConsValue(E h,
                 ListValue<E> t)
Method Detail

uncons

public void uncons(Token caller)
Description copied from interface: ListLike
Return the head and tail of a cons-like data structure to a token, or die. The only place this should be called is TryCons

Specified by:
uncons in interface ListLike
Specified by:
uncons in class ListValue<E>

unnil

public void unnil(Token caller)
Description copied from interface: ListLike
Signal a token if this value is equivalent to nil, or die. The only place this should be called is TryNil

Specified by:
unnil in interface ListLike
Specified by:
unnil in class ListValue<E>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

enlist

public java.util.List<E> enlist()
Specified by:
enlist in class ListValue<E>

accept

public <T> T accept(Visitor<T> visitor)
Overrides:
accept in class ListValue<E>

equals

public boolean equals(java.lang.Object that)
Specified by:
equals in interface java.util.Collection<E>
Overrides:
equals in class java.lang.Object

eqTo

public boolean eqTo(java.lang.Object that_)
Description copied from interface: Eq
Return true if this is equivalent to that. that is assumed to be non-null. This is often implemented in terms of Equal.eq(Object, Object). Two "eq" objects should have the same hashCode at the time they are compared.


hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<E>
Overrides:
hashCode in class java.lang.Object

contains

public boolean contains(java.lang.Object o)

isEmpty

public boolean isEmpty()

size

public int size()