public class GLBFunction extends MonotonicFunction
NOTE: It may seem counterintuitive that the constraint is "greater than or equal to" rather than "less than or equal to". But the latter constraint is already implied by the connections, since the output port type is required to be less than or equal to each destination port type. The combination of these constraints has the effect of setting the type of the output equal to the GLB of the types of the destination ports. This resolved type is, in fact, the most specific type that satisfies the constraints of all the downstream ports.
Red (cxh) |
Red (eal) |
Modifier and Type | Field and Description |
---|---|
protected InequalityTerm[] |
_cachedTerms
The types terms found in destination ports.
|
protected java.util.Set<Type> |
_cachedTypes
The constant types found in destination ports.
|
protected long |
_previousWorkspaceVersion
The workspace version number at time of last update of arguments.
|
protected TypedIOPort |
_sourcePort
The source port.
|
Constructor and Description |
---|
GLBFunction(TypedIOPort sourcePort)
Construct a GLBFunction that finds the greatest lower bound of the
type variable of the destination ports connected to the TypedIOPort
that is given as an argument.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_updateArguments()
Update the arguments used in
getValue() , which are the
InequalityTerms and Types of the destination ports. |
Type[] |
getConstants()
Return the type constants for this function, which are
the type constant types for all the destination ports.
|
java.lang.Object |
getValue()
Return the current value of this monotonic function.
|
InequalityTerm[] |
getVariables()
Return the type variables for this function, which are
the type variables for all the destination ports.
|
java.lang.String |
toString()
Provide a more descriptive string representation.
|
getAssociatedObject, getVerboseString, initialize, isSettable, isValueAcceptable, setValue
protected java.util.Set<Type> _cachedTypes
protected InequalityTerm[] _cachedTerms
protected long _previousWorkspaceVersion
protected TypedIOPort _sourcePort
public GLBFunction(TypedIOPort sourcePort)
GLBFunction
will be the inside destination ports.
Otherwise, the port is required to be an output port and the arguments
for this GLBFunction
will be the outside destination ports.sourcePort
- The port connected to the ports of which their type
variables are used to calculate the greatest lower bound.public java.lang.Object getValue() throws IllegalActionException
getValue
in interface InequalityTerm
getValue
in class MonotonicFunction
IllegalActionException
- If thrown while getting the
value of the cached terms.MonotonicFunction.setValue(Object)
public InequalityTerm[] getVariables()
getVariables
in interface InequalityTerm
getVariables
in class MonotonicFunction
public Type[] getConstants()
protected void _updateArguments()
getValue()
, which are the
InequalityTerms and Types of the destination ports. The arguments are
only updated if the workspace version has changed.public java.lang.String toString()
toString
in class MonotonicFunction