Mapper
Class Symbol

java.lang.Object
  extended by Mapper.Symbol

public class Symbol
extends java.lang.Object

This class implements a symbol of a grammar, be it a non-terminal or terminal symbol. It is used both by the Rule class, to specify its left side non-terminal symbols, and by the Production class, to specify its terminal and non-terminal symbols. It is also used by the Phenotype class, to specify phenotypic symbols.


Constructor Summary
Symbol()
          Default constructor, creates a symbol with an empty string.
Symbol(java.lang.String newString, Enums.SymbolType newType)
          Creates a symbol of type symbolType and with the string
Symbol(Symbol copy)
          Copy constructor
 
Method Summary
 void clear()
          Clears the string and type
 boolean equals(java.lang.String newSymbol)
          Compares the symbol strings of this and the symbol passed as a parameter
 boolean equals(Symbol newSymbol)
          Compare type and symbol string value
 java.lang.String getSymbolString()
          Get the symbol string
 Enums.SymbolType getType()
          Return the type of the symbol
 void setSymbolString(java.lang.String s)
          Set the string of the symbol
 void setType(Enums.SymbolType newType)
          Set the type of the symbol
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Symbol

public Symbol()
Default constructor, creates a symbol with an empty string.


Symbol

public Symbol(java.lang.String newString,
              Enums.SymbolType newType)
Creates a symbol of type symbolType and with the string

Parameters:
newString - string of symbol
newType - type of symbol

Symbol

public Symbol(Symbol copy)
Copy constructor

Parameters:
copy - symbol to copy
Method Detail

setType

public void setType(Enums.SymbolType newType)
Set the type of the symbol

Parameters:
newType - symbol type

getType

public Enums.SymbolType getType()
Return the type of the symbol

Returns:
symbol type

getSymbolString

public java.lang.String getSymbolString()
Get the symbol string

Returns:
string

setSymbolString

public void setSymbolString(java.lang.String s)
Set the string of the symbol

Parameters:
s - symbol string

equals

public boolean equals(Symbol newSymbol)
Compare type and symbol string value

Parameters:
newSymbol - symbol to compare
Returns:
if equal string and type true

equals

public boolean equals(java.lang.String newSymbol)
Compares the symbol strings of this and the symbol passed as a parameter

Parameters:
newSymbol - symbol string
Returns:
if strings equal true

clear

public void clear()
Clears the string and type


toString

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