Package ptolemy.moml.unit
Class Bindings
- java.lang.Object
-
- ptolemy.moml.unit.Bindings
-
public class Bindings extends java.lang.Object
Represents a set of bindings. Each binding is a (variable, Unit) pair where variable is a String. If the value of Unit is null, then the binding for the variable exists but its value is null. Since null is an allowable value the Hashtable class is not adequate.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Rowland R Johnson
- Pt.AcceptedRating:
- Red (rowland)
- Pt.ProposedRating:
- Red (rowland)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bindingExists(java.lang.String vLabel)
Return true if the binding exists.Unit
get(java.lang.String vLabel)
Get the value for a variable.java.lang.String
humanReadableForm()
A human readable form (more or less) of the bindings.void
put(java.lang.String varLabel, Unit U)
Create a binding for a variable and Unit.java.lang.String[]
variableLabels()
Create an array of Strings that contains all of the variables.
-
-
-
Constructor Detail
-
Bindings
public Bindings()
Construct Bindings with no members.
-
Bindings
public Bindings(java.util.Vector nodes)
Create bindings for a set of nodes in a CompositeEntity. The set of nodes can be a subset of the nodes in the CompositeEntity. Each port on each node yields a binding.- Parameters:
nodes
- The set of nodes(ComponentEntities).
-
-
Method Detail
-
bindingExists
public boolean bindingExists(java.lang.String vLabel)
Return true if the binding exists.- Parameters:
vLabel
- A String that represents the variable.- Returns:
- True if there exists a binding for the variable.
-
get
public Unit get(java.lang.String vLabel)
Get the value for a variable.- Parameters:
vLabel
- A String that represents the variable.- Returns:
- The value for the variable.
-
humanReadableForm
public java.lang.String humanReadableForm()
A human readable form (more or less) of the bindings.
-
put
public void put(java.lang.String varLabel, Unit U)
Create a binding for a variable and Unit. If a binding already exists for the variable, then update the Unit- Parameters:
varLabel
- A String that represents the variable.U
- The Unit.
-
variableLabels
public java.lang.String[] variableLabels()
Create an array of Strings that contains all of the variables.- Returns:
- An array of Strings containing the variables.
-
-