public class ExtractFieldType extends MonotonicFunction
The getValue()
method is used to get the current value of the
function. If the port type is an AssociateType
with a field for
the specified field name, then the function returns the type of that field.
If the port type is BaseType.GENERAL
, then return
BaseType.GENERAL
, or if the type is BaseType.UNKNOWN
,
then return BaseType.UNKNOWN
.
If the port type is AssociateType
but it has no
corresponding field, then return BaseType.GENERAL
.
Otherwise, the getValue() method throws an exception, which makes the
function partial.
Red |
Red (marten) |
Constructor and Description |
---|
ExtractFieldType(TypedIOPort port,
java.lang.String name)
Construct a new monotonic function.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue()
Return the current value of this monotonic function.
|
InequalityTerm[] |
getVariables()
Return the type variables in this inequality term.
|
java.lang.String |
getVerboseString()
Return an additional string describing the current value
of this function.
|
getAssociatedObject, initialize, isSettable, isValueAcceptable, setValue, toString
public ExtractFieldType(TypedIOPort port, java.lang.String name)
port
- The port of which the type is extracted the field fromname
- The name of the field of interestpublic java.lang.Object getValue() throws IllegalActionException
BaseType.GENERAL
,
then return BaseType.GENERAL
, or if the type is
BaseType.UNKNOWN
, then return
BaseType.UNKNOWN
. If the port type is
AssociateType
but it has no corresponding field,
then return BaseType.GENERAL
.
Otherwise, throw an exception.getValue
in interface InequalityTerm
getValue
in class MonotonicFunction
IllegalActionException
- If the port type is
not BaseType.UNKNOWN
or BaseType.GENERAL
and is not an instance of AssociateType
.MonotonicFunction.setValue(Object)
public java.lang.String getVerboseString()
getVerboseString
in class MonotonicFunction
public InequalityTerm[] getVariables()
getVariables
in interface InequalityTerm
getVariables
in class MonotonicFunction