Building Parsers with Java

sjm.engine
Class EmptyList

java.lang.Object
  |
  +--sjm.engine.Structure
        |
        +--sjm.engine.Fact
              |
              +--sjm.engine.EmptyList

public class EmptyList
extends Fact

The EmptyList is a list with no terms.

All lists except this one contain a head, which may be any term, and a tail, which is another list. This recursive defintion terminates with this singleton, the empty list.


Fields inherited from class sjm.engine.Fact
resolvent
 
Fields inherited from class sjm.engine.Structure
emptyList, functor, terms
 
Constructor Summary
protected EmptyList()
          Constructs the empty list singleton.
 
Method Summary
 boolean isList()
          Return true, since an empty list is a list.
 java.lang.String listTailString()
          Returns a string representation of this list as a part of another list.
 java.lang.String toString()
          Returns a string representation of the empty list.
 
Methods inherited from class sjm.engine.Fact
copyForProof, dynamicAxiom, facts, head, resolvent, unify
 
Methods inherited from class sjm.engine.Structure
arity, canFindNextProof, equals, eval, functorAndArityEquals, headAndTail, list, list, list, listTermsToString, terms, unify, unify, unify, variables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmptyList

protected EmptyList()
Constructs the empty list singleton.
Method Detail

isList

public boolean isList()
Return true, since an empty list is a list.
Overrides:
isList in class Structure
Returns:
true

listTailString

public java.lang.String listTailString()
Returns a string representation of this list as a part of another list. When the empty list represents itself as part of another list, it just returns "".
Overrides:
listTailString in class Structure
Returns:
an empty string

toString

public java.lang.String toString()
Returns a string representation of the empty list.
Overrides:
toString in class Structure
Returns:
a string representation of the empty list

by Steve Metsker