Orbital library

orbital.moon.logic
Class UniqueSymbol

java.lang.Object
  extended by orbital.logic.sign.SymbolBase
      extended by orbital.moon.logic.UniqueSymbol
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Symbol, Typed, Variable

public final class UniqueSymbol
extends SymbolBase

A new unique symbol that is distinct from all others. UniqueSymbols will only be equal to themselves (compared with ==). Note that the signifier IDs are used for printing, and for comparison of Symbols with UniqueSymbols, but for comparisons of UniqueSymbols with Symbols (then that's achieved by reference comparison).

See Also:
Serialized Form
Invariants:
(this.equals(b) ⇔ this == b) ∧ this.hashCode() == System.identityHashCode(this)

Field Summary
 
Fields inherited from class orbital.logic.sign.SymbolBase
BOOLEAN_ATOM, UNIVERSAL_ATOM
 
Constructor Summary
UniqueSymbol(java.lang.String signifierPrefix, Type type, Notation.NotationSpecification notation, boolean variable)
          Create a new unique symbol of (display) signifier starting with signifierPrefix.
UniqueSymbol(Type type, Notation.NotationSpecification notation, boolean variable)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares two symbols for equality according to their three components.
 int hashCode()
          Returns the hash code value for this symbol.
 void setNotation(Notation.NotationSpecification notation)
          Set the notation used when this symbol occurs.
 void setSignifier(java.lang.String signifier)
          Set the signifier representing this symbol.
 void setSpecification(Functor.Specification spec)
           
 
Methods inherited from class orbital.logic.sign.SymbolBase
compareTo, getNotation, getSignifier, getType, isVariable, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniqueSymbol

public UniqueSymbol(java.lang.String signifierPrefix,
                    Type type,
                    Notation.NotationSpecification notation,
                    boolean variable)
Create a new unique symbol of (display) signifier starting with signifierPrefix.


UniqueSymbol

public UniqueSymbol(Type type,
                    Notation.NotationSpecification notation,
                    boolean variable)
Method Detail

equals

public final boolean equals(java.lang.Object o)
Description copied from interface: Symbol
Compares two symbols for equality according to their three components. Two symbols are equal if they have the same signifier, type specification and notation. Then it should be asserted that they are either both variable, or both constant, because the sets of variable symbols and constant symbols are usually assumed disjunct.

Specified by:
equals in interface Symbol
Overrides:
equals in class SymbolBase

hashCode

public final int hashCode()
Description copied from interface: Symbol
Returns the hash code value for this symbol. The hash code of a symbol is defined to be the bitwise exclusive or of its components: signifier, type specification, and notation.

Specified by:
hashCode in interface Symbol
Overrides:
hashCode in class SymbolBase

setSignifier

public void setSignifier(java.lang.String signifier)
Description copied from interface: Symbol
Set the signifier representing this symbol.

Specified by:
setSignifier in interface Symbol
Overrides:
setSignifier in class SymbolBase

setSpecification

public void setSpecification(Functor.Specification spec)

setNotation

public void setNotation(Notation.NotationSpecification notation)
Description copied from interface: Symbol
Set the notation used when this symbol occurs. This includes precedence and associativity information, as well.

Specified by:
setNotation in interface Symbol
Overrides:
setNotation in class SymbolBase
Parameters:
notation - the notation used when this symbol occurs.

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.