Package ptolemy.data.type
Interface Typeable
-
- All Superinterfaces:
HasTypeConstraints
- All Known Implementing Classes:
AbstractInitializableParameter
,AreaEventType
,Assert.AssertPort
,BaseUnit
,ChannelPort
,ChoiceParameter
,ChoiceStringParameter
,ColorAttribute
,ConstantPublisherPort
,Constraint
,ConstraintMonitor
,ContainerIgnoringAttribute
,CPort
,DDEIOPort
,DebuggerParameter
,DefaultDirectoryAttribute
,DefaultIconLink
,DefaultIconScript
,DefaultModelAttribute
,DefaultTitle
,DoubleRangeParameter
,DygraphsJSPlotterAttribute
,Event.EventParameter
,ExpertParameter
,FileParameter
,FilePortParameter
,GTParameter
,HierarchyFlatteningAttribute
,HTMLImage
,HTMLText
,HTMLTextPosition
,IconLink
,IconScript
,IntRangeParameter
,IterateOverArray.IteratePort
,IterativeParameter
,JSAccessor.ActionableAttribute
,JSPlotterAttribute
,LinkTarget
,LinkToOpenTableaux
,LiveLink
,LocationAttribute
,LocationParameter
,MetroIIPtidesPlatform.PtidesMirrorPort
,MetroIIPtidesPort
,MirrorPort
,MirrorPortParameter
,ModalBasePort
,ModalPort
,ModalRefinementPort
,ModelIOPort
,ModelParameter
,MultiCompositePort
,NamedObjVariable
,NameParameter
,Parameter
,ParameterDisplayIconScript
,ParameterMirrorPort
,ParameterPort
,ParametersAttribute
,PasswordAttribute
,PortMatcher
,PortParameter
,Priority
,ProcessAttribute
,PtalonExpressionParameter
,PtalonParameter
,PtidesPlatform.PtidesMirrorPort
,PtidesPort
,PublisherPort
,PubSubPort
,QueuedTypedIOPort
,RefinementPort
,RefinementPort
,RelationCollapsingAttribute
,RelationHidingAttribute
,Script
,SDFIOPort
,SequenceAttribute
,SharedParameter
,SingletonParameter
,SIPrefixUnitConversionInfo
,SizeAttribute
,StringConstantParameter
,StringParameter
,SubscriberPort
,SubscriptionAggregatorPort
,SynchronizeToRealtime
,TableauParameter
,TDLRefinementPort
,TDLTaskPort
,TemporaryVariable
,TestSharedParameter
,Title
,TransformationMode
,TransitionRefinementPort
,TypeAttribute
,TypedIOPort
,UnitConversionInfo
,Variable
,WebContent
,WindowPropertiesAttribute
,WirelessIOPort
public interface Typeable extends HasTypeConstraints
Interface for objects with types. This interface defines methods for setting and getting types and type constraints. Type constraints are represented as inequalities between Typeable objects.- Since:
- Ptolemy II 0.4
- Version:
- $Id$
- Author:
- Yuhong Xiong, Xiaojun Liu, Edward A. Lee
- See Also:
InequalityTerm
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (yuhong)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Type
getType()
Return the type of this object.InequalityTerm
getTypeTerm()
Return an InequalityTerm representing this object.boolean
isTypeAcceptable()
Check whether the type of this object is acceptable.void
setTypeAtLeast(Typeable lesser)
Constrain the type of this object to be equal to or greater than the type of the argument.void
setTypeAtLeast(InequalityTerm typeTerm)
Constrain the type of this object to be equal to or greater than the type represented by the specified InequalityTerm.void
setTypeAtMost(Type type)
Constrain the type of this object to be equal to or less than the argument.void
setTypeEquals(Type type)
Set a type constraint that the type of this object equal the specified value.void
setTypeSameAs(Typeable equal)
Constrain the type of this object to be the same as the type of the argument.-
Methods inherited from interface ptolemy.data.type.HasTypeConstraints
typeConstraints
-
-
-
-
Method Detail
-
getType
Type getType() throws IllegalActionException
Return the type of this object. An exception is thrown if the type cannot be determined. This can happen if the type of this object is dependent on some other objects whose value is not available yet.- Returns:
- An instance of Type.
- Throws:
IllegalActionException
- If the type cannot be determined.
-
getTypeTerm
InequalityTerm getTypeTerm()
Return an InequalityTerm representing this object.- Returns:
- An InequalityTerm.
-
isTypeAcceptable
boolean isTypeAcceptable()
Check whether the type of this object is acceptable.- Returns:
- True if the type of this object is acceptable.
-
setTypeAtLeast
void setTypeAtLeast(Typeable lesser)
Constrain the type of this object to be equal to or greater than the type of the argument. Notice that this constraint is not enforced until type resolution is done, and is not enforced if type resolution is not done.- Parameters:
lesser
- A Typeable object.
-
setTypeAtLeast
void setTypeAtLeast(InequalityTerm typeTerm)
Constrain the type of this object to be equal to or greater than the type represented by the specified InequalityTerm. Notice that this constraint is not enforced until type resolution is done, and is not enforced if type resolution is not done.- Parameters:
typeTerm
- An InequalityTerm object.
-
setTypeAtMost
void setTypeAtMost(Type type) throws IllegalActionException
Constrain the type of this object to be equal to or less than the argument. Because the argument is a concrete type, rather than a Typeable object (which may not yet have a type), the constraint is immediately enforced.- Parameters:
type
- An instance of Type.- Throws:
IllegalActionException
- If the type of this object already violates this constraint.
-
setTypeEquals
void setTypeEquals(Type type) throws IllegalActionException
Set a type constraint that the type of this object equal the specified value.- Parameters:
type
- An instance of Type.- Throws:
IllegalActionException
- If the type of this object already violates this constraint.
-
setTypeSameAs
void setTypeSameAs(Typeable equal)
Constrain the type of this object to be the same as the type of the argument. Notice that this constraint is not enforced until type resolution is done, and is not enforced if type resolution is not done.- Parameters:
equal
- The type that this object should be the same as.
-
-