sexp
Class SEmpty

java.lang.Object
  extended by sexp.SEmpty
All Implemented Interfaces:
Iterable<SExp>, SExp, SList

public class SEmpty
extends Object
implements SList

SEmpty represents the empty list.


Constructor Summary
SEmpty()
           
 
Method Summary
<T> T
accept(SExpVisitor<T> visitor)
          Apply a visitor to this s-expression.
 boolean equals(Object obj)
           
 SExp first()
           
 SExp get(int i)
           
 int hashCode()
           
 boolean isEmpty()
           
 Iterator<SExp> iterator()
           
 SList rest()
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SEmpty

public SEmpty()
Method Detail

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface SList
Returns:

first

public SExp first()
Specified by:
first in interface SList
Returns:
first expression in this list

rest

public SList rest()
Specified by:
rest in interface SList
Returns:
remaining expressions after removing the first

get

public SExp get(int i)
Specified by:
get in interface SList
Returns:
ith element of this list, numbered from 0

size

public int size()
Specified by:
size in interface SList
Returns:
number of subexpressions, i.e. elements in this list

iterator

public Iterator<SExp> iterator()
Specified by:
iterator in interface Iterable<SExp>
Specified by:
iterator in interface SList
Returns:
iterator that yields the subexpressions of this list in order from left to right

accept

public <T> T accept(SExpVisitor<T> visitor)
Description copied from interface: SExp
Apply a visitor to this s-expression.

Specified by:
accept in interface SExp

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object