|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
scphEditor.CloneableObservable
scphEditor.OperandVector
scphEditor.Operand
scphEditor.Identifier
public class Identifier
This class models terminal expressions, such as variables and constants like x and 10. An Identifier object has a name, and this is precisely the x or 10 part. It could also have an alternative name to be used with the theorem prover.
It implements Operator, because variables and constants are degenerate cases of functions.
It is a subclass of Operand as well. It is an operand that has no child and an operator - itself.
Identifier objects are designed to be flyweights. You can use the lookup method to look up an existing Identifier object by its name.
Field Summary |
---|
Fields inherited from interface scphEditor.IOperator |
---|
ASSOC, LEFT, nARY, NONASSOC, RIGHT |
Constructor Summary | |
---|---|
protected |
Identifier(java.lang.String nameOf)
Creates an identifier with the given name. |
protected |
Identifier(java.lang.String nameOf,
java.lang.String pnameOf)
Creates an identifier with the given name and prover name. |
Method Summary | |
---|---|
void |
acceptVisitor(OperandVisitor v)
Calls v.visitIdentifier(this). |
int |
arity()
Returns the arity of this identifier (as an operator). |
int |
associative()
Returns the associativity of this identifier (as an operator). |
java.lang.Object |
clone()
``Clones'' this identifier. |
boolean |
commutative()
Returns the commutativity of this identifier (as an operator). |
IEmbedding |
format()
|
java.lang.String |
getName()
Returns the name of this identifier. |
IOperator |
getOperator()
Gives the operator in this identifier operand, which is the identifier itself. |
java.lang.String |
getPName()
Returns the prover name of this identifier. |
java.lang.String |
id()
|
static Identifier |
lookup(java.lang.String name)
Looks up an Identifier object from the dictionary. |
int |
precedence()
Returns the precedence of this identifier (as an operator). |
java.lang.String[] |
proverName()
|
java.lang.String |
proverName0()
|
Methods inherited from class scphEditor.Operand |
---|
addParen, deParen, ensureParen, getParen, getSplit, needParen, removeParen, setSplit |
Methods inherited from class scphEditor.OperandVector |
---|
addChild, countChildren, delChild, getChild, getChildren, setChild |
Methods inherited from class scphEditor.CloneableObservable |
---|
addObserver, cloneObserverList, cloneObserverList, countObservers, deleteObserver, deleteObservers, notifyObservers, notifyObservers |
Methods inherited from class java.util.Observable |
---|
clearChanged, hasChanged, setChanged |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Identifier(java.lang.String nameOf)
nameOf
- The name.protected Identifier(java.lang.String nameOf, java.lang.String pnameOf)
nameOf
- The name.pnameOf
- The prover name.Method Detail |
---|
public static Identifier lookup(java.lang.String name)
name
- The [prover] name of the desired identifier.
public java.lang.String getName()
public java.lang.String getPName()
public int precedence()
precedence
in interface IOperator
public int associative()
associative
in interface IOperator
public boolean commutative()
commutative
in interface IOperator
public int arity()
arity
in interface IOperator
public java.lang.Object clone()
clone
in class Operand
public IOperator getOperator()
getOperator
in class Operand
IOperator
public void acceptVisitor(OperandVisitor v)
acceptVisitor
in class Operand
v
- the visitor object that wants to visit this operand.public java.lang.String id()
id
in interface IOperator
public IEmbedding format()
format
in interface IOperator
public java.lang.String[] proverName()
proverName
in interface IOperator
public java.lang.String proverName0()
proverName0
in interface IOperator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |