ptolemy.data.expr
Class Variable.TypeTerm

java.lang.Object
  extended by ptolemy.data.expr.Variable.TypeTerm
All Implemented Interfaces:
InequalityTerm
Enclosing class:
Variable

private class Variable.TypeTerm
extends java.lang.Object
implements InequalityTerm


Constructor Summary
private Variable.TypeTerm()
           
 
Method Summary
 java.lang.Object getAssociatedObject()
          Return this Variable.
 java.lang.Object getValue()
          Return the type of this Variable.
 InequalityTerm[] getVariables()
          Return this TypeTerm in an array if this term represent a type variable.
 void initialize(java.lang.Object e)
          Reset the variable part of this type to the specified type.
 boolean isSettable()
          Test if the type of this variable is fixed.
 boolean isValueAcceptable()
          Check whether the current value of this term is acceptable.
 void setValue(java.lang.Object e)
          Set the type of this variable.
 java.lang.String toString()
          Override the base class to give a description of the variable and its type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable.TypeTerm

private Variable.TypeTerm()
Method Detail

getAssociatedObject

public java.lang.Object getAssociatedObject()
Return this Variable.

Specified by:
getAssociatedObject in interface InequalityTerm
Returns:
A Variable.

getValue

public java.lang.Object getValue()
Return the type of this Variable.

Specified by:
getValue in interface InequalityTerm
Returns:
An Object representing an element in the underlying CPO.
See Also:
InequalityTerm.setValue(Object)

getVariables

public InequalityTerm[] getVariables()
Return this TypeTerm in an array if this term represent a type variable. This term represents a type variable if the type of this variable is not set through setTypeEquals(). If the type of this variable is set, return an array of size zero.

Specified by:
getVariables in interface InequalityTerm
Returns:
An array of InequalityTerm.

initialize

public void initialize(java.lang.Object e)
                throws IllegalActionException
Reset the variable part of this type to the specified type.

Specified by:
initialize in interface InequalityTerm
Parameters:
e - A Type.
Throws:
IllegalActionException - If the type is not settable, or the argument is not a Type.

isSettable

public boolean isSettable()
Test if the type of this variable is fixed. The type is fixed if setTypeEquals() is called with an argument that is not BaseType.UNKNOWN, or the user has set a non-null expression or token into this variable.

Specified by:
isSettable in interface InequalityTerm
Returns:
True if the type of this variable can be set; false otherwise.

isValueAcceptable

public boolean isValueAcceptable()
Check whether the current value of this term is acceptable. This method delegates the check to the isTypeAcceptable() method of the outer class.

Specified by:
isValueAcceptable in interface InequalityTerm
Returns:
True if the current value is acceptable.

setValue

public void setValue(java.lang.Object e)
              throws IllegalActionException
Set the type of this variable.

Specified by:
setValue in interface InequalityTerm
Parameters:
e - a Type.
Throws:
IllegalActionException - If this type is not settable, or this type cannot be updated to the new type.
See Also:
InequalityTerm.getValue()

toString

public java.lang.String toString()
Override the base class to give a description of the variable and its type.

Overrides:
toString in class java.lang.Object
Returns:
A description of the variable and its type.