|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
com.singularsys.jep.VariableTable
public class VariableTable
A table of variables.
This class implements Observable and observers will be notified
when new variables are added, or removed, but not when their values are changed.
Use Variable.addObserver()
to monitor individual variables.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,Variable> |
table
|
protected VariableFactory |
vf
|
Constructor Summary | |
---|---|
VariableTable()
|
Method Summary | |
---|---|
Variable |
addVariable(java.lang.String name)
Adds a new variable with no value specified. |
Variable |
addVariable(java.lang.String name,
java.lang.Object value)
Adds a new variable with specified value. |
Variable |
addVariable(java.lang.String name,
java.lang.Object value,
VariableFactory varFac)
Adds a new variable with specified value. |
void |
clear()
Clears all variables from the table. |
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads. |
Variable |
getVariable(java.lang.String name)
Gets an existing variable, returns null if variable is not found. |
java.util.Collection<Variable> |
getVariables()
Returns all the variable in the table. |
void |
init(Jep j)
Initialize the component. |
boolean |
isEmpty()
|
java.util.Set<java.lang.String> |
keySet()
|
JepComponent |
newInstance()
|
Variable |
remove(java.lang.String varname)
Remove a variable with a given name from the table. |
Variable |
remove(Variable var)
Remove a variable from the table. |
int |
size()
|
java.lang.String |
toString()
|
java.util.Collection<Variable> |
values()
Deprecated. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,Variable> table
protected transient VariableFactory vf
Constructor Detail |
---|
public VariableTable()
Method Detail |
---|
public void init(Jep j)
JepComponent
init
in interface JepComponent
j
- the current Jep instancepublic Variable addVariable(java.lang.String name)
Variable
instance is created with the variable factory.
name
- the variable's name
public Variable addVariable(java.lang.String name, java.lang.Object value)
name
- the name of the variablevalue
- the value for the variable to be set to
public Variable addVariable(java.lang.String name, java.lang.Object value, VariableFactory varFac)
name
- the name of the variablevalue
- the value for the variable to be set tovarFac
- the variable factory to use if a variable needs to be created
public Variable getVariable(java.lang.String name)
name
-
public void clear()
public boolean isEmpty()
public java.util.Set<java.lang.String> keySet()
public java.util.Collection<Variable> getVariables()
public Variable remove(java.lang.String varname)
varname
- name of the variable to remove
public Variable remove(Variable var)
var
- the variable to remove
@Deprecated public java.util.Collection<Variable> values()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
public JepComponent newInstance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |