ptolemy.actor
Class TypedIOPort.TypeTerm

java.lang.Object
  extended by ptolemy.actor.TypedIOPort.TypeTerm
All Implemented Interfaces:
InequalityTerm
Enclosing class:
TypedIOPort

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


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

Constructor Detail

TypedIOPort.TypeTerm

private TypedIOPort.TypeTerm()
Method Detail

getAssociatedObject

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

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

getValue

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

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 port is not set through setTypeEquals(). If the type of this port 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 type)
                throws IllegalActionException
Reset the variable part of this type to the specified type.

Specified by:
initialize in interface InequalityTerm
Parameters:
type - 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 TypedIOPort can be changed. The type can be changed if setTypeEquals() is not called, or called with a BaseType.UNKNOWN argument.

Specified by:
isSettable in interface InequalityTerm
Returns:
True if the type of this TypedIOPort can be changed; 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 type)
              throws IllegalActionException
Set the type of this port.

Specified by:
setValue in interface InequalityTerm
Parameters:
type - A Type.
Throws:
IllegalActionException - If the new type violates the declared type of this port.
See Also:
InequalityTerm.getValue()

toString

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

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