Package ptolemy.actor.util
Class ConstructAssociativeType
- java.lang.Object
-
- ptolemy.data.type.MonotonicFunction
-
- ptolemy.actor.util.ConstructAssociativeType
-
- All Implemented Interfaces:
InequalityTerm
public class ConstructAssociativeType extends MonotonicFunction
A function that, given a list of ports, returns aStructuredTypeof which the fields names and field types correspond with the given ports. The arguments to this function (the array returned by getVariables()) represent the types of the ports, in the same order as the ports are defined. The concrete subclass ofStructuredTypethat is to be instantiated by this function depends on the type parameter passed to the constructor.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Edward A. Lee, Marten Lohstroh
- Pt.AcceptedRating:
- Red
- Pt.ProposedRating:
- Red (marten)
-
-
Constructor Summary
Constructors Constructor Description ConstructAssociativeType(java.util.Collection<TypedIOPort> ports, java.lang.Class<? extends AssociativeType> type)Construct a new monotonic function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetValue()Return a RecordType with field names equal to the given port names, and field types equal to the current inferred or declared type of the corresponding ports.InequalityTerm[]getVariables()Return the type variables for this function, which are the type variables for all the ports that do not have declared types.-
Methods inherited from class ptolemy.data.type.MonotonicFunction
getAssociatedObject, getVerboseString, initialize, isSettable, isValueAcceptable, setValue, toString
-
-
-
-
Constructor Detail
-
ConstructAssociativeType
public ConstructAssociativeType(java.util.Collection<TypedIOPort> ports, java.lang.Class<? extends AssociativeType> type)
Construct a new monotonic function.- Parameters:
ports- A list of ports used to construct the AssociativeTypetype- A specific subclass to instantiate
-
-
Method Detail
-
getValue
public java.lang.Object getValue() throws IllegalActionExceptionReturn a RecordType with field names equal to the given port names, and field types equal to the current inferred or declared type of the corresponding ports.- Specified by:
getValuein interfaceInequalityTerm- Specified by:
getValuein classMonotonicFunction- Returns:
- A RecordType.
- Throws:
IllegalActionException- If thrown while getting the value of the typeTerm of the port or while instantiating a type.- See Also:
MonotonicFunction.setValue(Object)
-
getVariables
public InequalityTerm[] getVariables()
Return the type variables for this function, which are the type variables for all the ports that do not have declared types.- Specified by:
getVariablesin interfaceInequalityTerm- Specified by:
getVariablesin classMonotonicFunction- Returns:
- An array of InequalityTerm.
-
-