ptolemy.data.type
Class ArrayType.TypeableSizedArrayTypeTerm

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

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

An InequalityTerm representing an array types whose elements have the type of the specified 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. This term is not variable and cannot be set.


Field Summary
private  ArrayType _arrayType
          The array type with element types matching the typeable.
private  int _length
           
private  Typeable _typeable
          The associated typeable.
 
Constructor Summary
ArrayType.TypeableSizedArrayTypeTerm(Typeable typeable, int length)
          Construct a term that will defer to the type of the specified typeable.
 
Method Summary
private  ArrayType _getArrayType()
          Get an array type with element type matching the type of the associated typeable.
private  ArrayType _getArrayTypeRaw()
          Get an array type with element type matching the type of the associated typeable.
 java.lang.Object getAssociatedObject()
          Return an array type with element types given by the associated typeable.
 java.lang.Object getValue()
          Return an array type with element types given by the associated typeable.
 InequalityTerm[] getVariables()
          Return an array of size zero.
 void initialize(java.lang.Object e)
          Throw an exception.
 boolean isSettable()
          Return false.
 boolean isValueAcceptable()
          Delegate to an array type with elements given by the type of the associated typeable.
 void setValue(java.lang.Object type)
          Throw an exception.
 java.lang.String toString()
          Delegate to an array type with elements given by the type 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.


_arrayType

private ArrayType _arrayType
The array type with element types matching the typeable.


_length

private int _length
Constructor Detail

ArrayType.TypeableSizedArrayTypeTerm

public ArrayType.TypeableSizedArrayTypeTerm(Typeable typeable,
                                            int length)
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()
Return an array type with element types given by the associated typeable.

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

getValue

public java.lang.Object getValue()
                          throws IllegalActionException
Return an array type with element types given by the associated typeable.

Specified by:
getValue in interface InequalityTerm
Returns:
An ArrayType.
Throws:
IllegalActionException - If the type of the associated typeable cannot be determined.
See Also:
InequalityTerm.setValue(Object)

getVariables

public InequalityTerm[] getVariables()
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
Throw an exception. This term cannot be set.

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

isSettable

public boolean isSettable()
Return false.

Specified by:
isSettable in interface InequalityTerm
Returns:
False.

isValueAcceptable

public boolean isValueAcceptable()
Delegate to an array type with elements given by the type 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
Throw an exception.

Specified by:
setValue in interface InequalityTerm
Parameters:
type - a Type.
Throws:
IllegalActionException - Always
See Also:
InequalityTerm.getValue()

toString

public java.lang.String toString()
Delegate to an array type with elements given by the type of the associated typeable.

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

_getArrayType

private ArrayType _getArrayType()
Get an array type with element type matching the type of the associated typeable.

Returns:
An array type for the associated typeable.

_getArrayTypeRaw

private ArrayType _getArrayTypeRaw()
                            throws IllegalActionException
Get an array type with element type matching the type of the associated typeable.

Returns:
An array type for the associated typeable.
Throws:
IllegalActionException - If the type of the typeable cannot be determined.