sexp
Class SEmpty
java.lang.Object
sexp.SEmpty
- All Implemented Interfaces:
- Iterable<SExp>, SExp, SList
public class SEmpty
- extends Object
- implements SList
SEmpty represents the empty list.
SEmpty
public SEmpty()
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