orc.runtime.values
Class ListValue<E>

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

public abstract class ListValue<E>
extends Value
implements java.lang.Iterable<E>, ListLike, java.util.Collection<E>, Eq

Common ancestor for ConsValue and NilValue. Unlike scheme, the Cons constructor does not allow you to create a degenerate cons where the tail is not a list, so we can guarantee that all Conses actually have a list structure. (If you want a degenerate cons, just use a tuples.)


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

Constructor Detail

ListValue

public ListValue()
Method Detail

enlist

public abstract java.util.List<E> enlist()

make

public static <E> ListValue<E> make(E[] vs)

make

public static <E> ListValue<E> make(java.util.List<E> vs)

iterator

public java.util.Iterator<E> iterator()
Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface java.util.Collection<E>

accept

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

uncons

public abstract 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

unnil

public abstract 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

add

public boolean add(E arg0)
Specified by:
add in interface java.util.Collection<E>

addAll

public boolean addAll(java.util.Collection<? extends E> arg0)
Specified by:
addAll in interface java.util.Collection<E>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<E>

containsAll

public boolean containsAll(java.util.Collection<?> arg0)
Specified by:
containsAll in interface java.util.Collection<E>

remove

public boolean remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Collection<E>

removeAll

public boolean removeAll(java.util.Collection<?> arg0)
Specified by:
removeAll in interface java.util.Collection<E>

retainAll

public boolean retainAll(java.util.Collection<?> arg0)
Specified by:
retainAll in interface java.util.Collection<E>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<E>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<E>