com.sun.msv.grammar
Class ValueExp

java.lang.Object
  extended by com.sun.msv.grammar.Expression
      extended by com.sun.msv.grammar.ValueExp
All Implemented Interfaces:
DataOrValueExp, Serializable

public final class ValueExp
extends Expression
implements DataOrValueExp

Expression that matchs a particular value of a Datatype.

Author:
Kohsuke KAWAGUCHI
See Also:
Serialized Form

Field Summary
 Datatype dt
          Datatype object that is used to test the equality.
 StringPair name
          name of this datatype.
 Object value
          This expression matches this value only.
 
Fields inherited from class com.sun.msv.grammar.Expression
anyString, epsilon, nullSet, verifierTag
 
Constructor Summary
protected ValueExp(Datatype dt, StringPair typeName, Object value)
           
 
Method Summary
protected  boolean calcEpsilonReducibility()
          computes epsilon reducibility
protected  int calcHashCode()
          Computes the hashCode again.
 boolean equals(Object o)
           
 StringPair getName()
           
 Datatype getType()
           
 Object visit(ExpressionVisitor visitor)
           
 boolean visit(ExpressionVisitorBoolean visitor)
           
 Expression visit(ExpressionVisitorExpression visitor)
           
 void visit(ExpressionVisitorVoid visitor)
           
 
Methods inherited from class com.sun.msv.grammar.Expression
getExpandedExp, hashCode, hashCode, hashCode, isEpsilonReducible, peelOccurence, readResolve, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dt

public final Datatype dt
Datatype object that is used to test the equality.


value

public final Object value
This expression matches this value only.


name

public final StringPair name
name of this datatype. The value of this field is not considered as significant. When two TypedStringExps share the same Datatype object, then they are unified even if they have different names.

Constructor Detail

ValueExp

protected ValueExp(Datatype dt,
                   StringPair typeName,
                   Object value)
Method Detail

getType

public Datatype getType()
Specified by:
getType in interface DataOrValueExp

getName

public StringPair getName()
Specified by:
getName in interface DataOrValueExp

calcHashCode

protected final int calcHashCode()
Description copied from class: Expression
Computes the hashCode again.

This method and the parameter to the constructor has to be the same. This method is used when the object is being read from the stream.

Specified by:
calcHashCode in class Expression

equals

public boolean equals(Object o)
Specified by:
equals in class Expression

visit

public Object visit(ExpressionVisitor visitor)
Specified by:
visit in class Expression

visit

public Expression visit(ExpressionVisitorExpression visitor)
Specified by:
visit in class Expression

visit

public boolean visit(ExpressionVisitorBoolean visitor)
Specified by:
visit in class Expression

visit

public void visit(ExpressionVisitorVoid visitor)
Specified by:
visit in class Expression

calcEpsilonReducibility

protected boolean calcEpsilonReducibility()
Description copied from class: Expression
computes epsilon reducibility

Specified by:
calcEpsilonReducibility in class Expression


MSV