learner
Class RankedSymbol

java.lang.Object
  extended by learner.RankedSymbol
All Implemented Interfaces:
java.lang.Comparable

public class RankedSymbol
extends java.lang.Object
implements java.lang.Comparable

The class RankedSymbol mimics the abstact data type ranked symbol, which consists of a symbol and a natural number. The number indicats how many subtrees a node labelled this symbol is expected to have.


Field Summary
 int rank
          the rank, a natural number indicating the symbols arity
 java.lang.String symbol
          the symbol itself
 
Constructor Summary
RankedSymbol(java.lang.String symbol, int rank)
          Constructs a ranked symbol, given an symbol and a rank.
 
Method Summary
 java.lang.Object clone()
           
 int compareTo(java.lang.Object o)
          Comparasion function
 boolean equals(java.lang.Object object)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

symbol

public java.lang.String symbol
the symbol itself


rank

public int rank
the rank, a natural number indicating the symbols arity

Constructor Detail

RankedSymbol

public RankedSymbol(java.lang.String symbol,
                    int rank)
Constructs a ranked symbol, given an symbol and a rank.

Parameters:
symbol - Any String will due.
rank - a natural number
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Comparasion function

Specified by:
compareTo in interface java.lang.Comparable

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object