Parsing Engine

danbikel.parser
Class SymbolPair

java.lang.Object
  extended by danbikel.util.Pair
      extended by danbikel.parser.SymbolPair
All Implemented Interfaces:
Serializable

public class SymbolPair
extends Pair

A simple class for holding a pair of Symbol objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class danbikel.util.Pair
first, second
 
Constructor Summary
SymbolPair()
          Constructs an empty pair of symbols (both objects are null).
SymbolPair(Sexp sexp)
          Constructs a SymbolPair from the first two symbols in the specified list.
SymbolPair(Symbol first, Symbol second)
          Constructs a new symbol pair from the specified symbols.
 
Method Summary
 Symbol first()
          Returns the first symbol in this pair.
 Symbol second()
          Returns the second symbol in this pair.
 String toString()
          Returns an S-expression list string representation of this symbol pair.
 
Methods inherited from class danbikel.util.Pair
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymbolPair

public SymbolPair()
Constructs an empty pair of symbols (both objects are null).


SymbolPair

public SymbolPair(Sexp sexp)
Constructs a SymbolPair from the first two symbols in the specified list. If the specified S-expression is not of type SexpList, or if the specified list does not have Symbol objects as its first two elements, this method will throw an ClassCastException.

Parameters:
sexp - the list whose first two symbol elements will be made into the two elements of this symbol pair

SymbolPair

public SymbolPair(Symbol first,
                  Symbol second)
Constructs a new symbol pair from the specified symbols.

Parameters:
first - the first symbol
second - the second symbol
Method Detail

first

public final Symbol first()
Returns the first symbol in this pair.


second

public final Symbol second()
Returns the second symbol in this pair.


toString

public String toString()
Returns an S-expression list string representation of this symbol pair.

Overrides:
toString in class Pair
Returns:
an S-expression list string representation of this symbol pair.

Parsing Engine

Author: Dan Bikel.