ptolemy.data.type
Class ArrayType.TypeableElementTypeTerm

java.lang.Object
  extended by ptolemy.data.type.ArrayType.TypeableElementTypeTerm
All Implemented Interfaces:
InequalityTerm
Enclosing class:
ArrayType

private static class ArrayType.TypeableElementTypeTerm
extends java.lang.Object
implements InequalityTerm

An InequalityTerm representing the element types of an instance of Typeable. The purpose of this class is to defer to as late as possible actually accessing the type of the typeable, since it may change dynamically.


Field Summary
private  Typeable _typeable
          The associated typeable.
 
Constructor Summary
ArrayType.TypeableElementTypeTerm(Typeable typeable)
          Construct a term that will defer to the type of the specified typeable.
 
Method Summary
private  InequalityTerm _getElementTypeTerm()
          Get an inequality term for elements of the associated typeable.
 java.lang.Object getAssociatedObject()
          Delegate to the element type term of the associated typeable.
 java.lang.Object getValue()
          Delegate to the element type term of the associated typeable.
 InequalityTerm[] getVariables()
          Delegate to the element type term of the associated typeable.
 void initialize(java.lang.Object type)
          Delegate to the element type term of the associated typeable.
 boolean isSettable()
          Delegate to the element type term of the associated typeable.
 boolean isValueAcceptable()
          Delegate to the element type term of the associated typeable.
 void setValue(java.lang.Object type)
          Delegate to the element type term of the associated typeable.
 java.lang.String toString()
          Delegate to the element type term of the associated typeable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_typeable

private Typeable _typeable
The associated typeable.

Constructor Detail

ArrayType.TypeableElementTypeTerm

public ArrayType.TypeableElementTypeTerm(Typeable typeable)
Construct a term that will defer to the type of the specified typeable.

Parameters:
typeable - The object to defer requests to.
Method Detail

getAssociatedObject

public java.lang.Object getAssociatedObject()
Delegate to the element type term of the associated typeable.

Specified by:
getAssociatedObject in interface InequalityTerm
Returns:
an ArrayType.

getValue

public java.lang.Object getValue()
                          throws IllegalActionException
Delegate to the element type term of the associated typeable.

Specified by:
getValue in interface InequalityTerm
Returns:
a Type.
Throws:
IllegalActionException - If the delegate throws it.
See Also:
InequalityTerm.setValue(Object)

getVariables

public InequalityTerm[] getVariables()
Delegate to the element type term of the associated typeable.

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

initialize

public void initialize(java.lang.Object type)
                throws IllegalActionException
Delegate to the element type term of the associated typeable.

Specified by:
initialize in interface InequalityTerm
Parameters:
type - A Type.
Throws:
IllegalActionException - If the delegate throws it.

isSettable

public boolean isSettable()
Delegate to the element type term of the associated typeable.

Specified by:
isSettable in interface InequalityTerm
Returns:
True if the element type is a type variable.

isValueAcceptable

public boolean isValueAcceptable()
Delegate to the element type term of the associated typeable.

Specified by:
isValueAcceptable in interface InequalityTerm
Returns:
True if the element type is acceptable.

setValue

public void setValue(java.lang.Object type)
              throws IllegalActionException
Delegate to the element type term of the associated typeable.

Specified by:
setValue in interface InequalityTerm
Parameters:
type - a Type.
Throws:
IllegalActionException - If the specified type violates the declared type of the element.
See Also:
InequalityTerm.getValue()

toString

public java.lang.String toString()
Delegate to the element type term of the associated typeable.

Overrides:
toString in class java.lang.Object
Returns:
A String.

_getElementTypeTerm

private InequalityTerm _getElementTypeTerm()
Get an inequality term for elements of the associated typeable. If the associated typeable does not already have an array type, then return null, indicating that the type of the typeable hasn't yet resolved to an array type.

Returns:
An array type for the associated typeable.