Class Seq2<T>

java.lang.Object
  extended by Seq<T>
      extended by Seq2<T>

public final class Seq2<T>
extends Seq<T>

A nonempty sequence subclass of Seq. See the documentation of Seq.


Nested Class Summary
 
Nested classes/interfaces inherited from class Seq
Seq.SeqIterator
 
Field Summary
protected  T car
           
protected  Seq<T> cdr
           
 
Constructor Summary
Seq2(T f)
           
Seq2(T f, Seq<T> r)
           
 
Method Summary
 Seq<T> copy()
          Accessor that copies the sequence.
 boolean equals(java.lang.Object obj)
           
 T getFirst()
          Accessor returning the first element in sequence.
protected  Seq<T> getSubseq()
           
 boolean isEmpty()
          Accessor testing emptyness.
 int length()
          Accessor determining length.
protected  Seq<T> reverseRecurs(Seq<T> buildMe)
           
 void setFirst(T t)
          Mutator that resets the first value of the sequence.
protected  void setSubseq(Seq<T> t)
           
protected  char[] toStringRecurs(int where)
           
 
Methods inherited from class Seq
iterator, reverse, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

car

protected T car

cdr

protected Seq<T> cdr
Constructor Detail

Seq2

public Seq2(T f,
            Seq<T> r)

Seq2

public Seq2(T f)
Method Detail

copy

public Seq<T> copy()
Description copied from class: Seq
Accessor that copies the sequence.

Specified by:
copy in class Seq<T>
Returns:
a clone

isEmpty

public boolean isEmpty()
Description copied from class: Seq
Accessor testing emptyness.

Specified by:
isEmpty in class Seq<T>
Returns:
true iff the sequence is empty

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

length

public int length()
Description copied from class: Seq
Accessor determining length.

Specified by:
length in class Seq<T>
Returns:
an int giving the length of the sequence

setFirst

public void setFirst(T t)
Description copied from class: Seq
Mutator that resets the first value of the sequence.

Specified by:
setFirst in class Seq<T>
Parameters:
t - a generic value to replace the first in the sequence

getFirst

public T getFirst()
Description copied from class: Seq
Accessor returning the first element in sequence.

Specified by:
getFirst in class Seq<T>
Returns:
the first element of the seqeunce.

setSubseq

protected void setSubseq(Seq<T> t)
Specified by:
setSubseq in class Seq<T>

getSubseq

protected Seq<T> getSubseq()
Specified by:
getSubseq in class Seq<T>

toStringRecurs

protected char[] toStringRecurs(int where)
Specified by:
toStringRecurs in class Seq<T>

reverseRecurs

protected Seq<T> reverseRecurs(Seq<T> buildMe)
Specified by:
reverseRecurs in class Seq<T>