gui.highlighting
Class Symbol

java.lang.Object
  extended by gui.highlighting.Symbol

public class Symbol
extends java.lang.Object

A Symbol represents the information shared between similar tokens, i.e. their type and spelling.


Field Summary
 java.lang.String name
          The spelling.
 int type
          The type is a small integer used to classify symbols.
 
Constructor Summary
Symbol(int type, java.lang.String name)
          Construct a symbol from its type and name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare the type and name with some other symbol.
 int hashCode()
          Form a hash value from the type and name.
 java.lang.String toString()
          Return the name of the symbol.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public int type
The type is a small integer used to classify symbols. It also distinguishes different symbols with the same spelling, where necessary.


name

public java.lang.String name
The spelling.

Constructor Detail

Symbol

public Symbol(int type,
              java.lang.String name)
Construct a symbol from its type and name.

Method Detail

toString

public java.lang.String toString()
Return the name of the symbol.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Form a hash value from the type and name.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare the type and name with some other symbol.

Overrides:
equals in class java.lang.Object