public class VariableTableObserver
extends java.lang.Object
implements java.util.Observer
Results are unpredictable if two variable tables are observed using the same object.
From 3.5 whether variable values are watched can be set
ObservingTest
Constructor and Description |
---|
VariableTableObserver(Jep jep)
Constructor watching the table of the Jep instance
|
VariableTableObserver(Jep jep,
boolean watchValues)
Constructor which allows the watching of individual variable values to be switchable
|
VariableTableObserver(VariableTable vt)
Constructor watching a specified table.
|
VariableTableObserver(VariableTable vt,
boolean watchValues)
Constructor specifying if values should be watched.
|
Modifier and Type | Method and Description |
---|---|
void |
addObserver(java.util.Observable obs) |
void |
addObservers(VariableTable vt) |
void |
deleteObserver(java.util.Observable obs) |
void |
deleteObservers()
Stop observing all variables.
|
boolean |
isWatchingValues()
Whether changes in variable values are watched
|
java.util.Iterator<java.util.Observable> |
iterator()
Returns a list of items this class is observing.
|
protected void |
tableCleared(VariableTable table)
Called when the variable table has been cleared.
|
void |
update(java.util.Observable o,
java.lang.Object arg)
Called when the Observable.notifyObservers() method is called.
|
protected void |
variableAdded(Variable var)
Called when a variable is added to the table.
|
protected void |
variableChanged(Variable var)
Called when a variable value has changed.
|
protected void |
variableRemoved(Variable var)
Called when a variable is removed from the table.
|
public VariableTableObserver(VariableTable vt)
vt
- public VariableTableObserver(Jep jep)
jep
- Jep instancepublic VariableTableObserver(VariableTable vt, boolean watchValues)
vt
- Table to watchwatchValues
- whether values should be watchedpublic VariableTableObserver(Jep jep, boolean watchValues)
jep
- watchValues
- whether to watch the change in variable values, setting to false will be a little quickerpublic void addObserver(java.util.Observable obs)
public void addObservers(VariableTable vt)
public void deleteObserver(java.util.Observable obs)
public void deleteObservers()
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
protected void variableChanged(Variable var)
var
- the variable which has changed.protected void variableAdded(Variable var)
var
- the variable which has been added.protected void variableRemoved(Variable var)
var
- the variable which has been removed.protected void tableCleared(VariableTable table)
table
- table which has been clearedpublic java.util.Iterator<java.util.Observable> iterator()
public boolean isWatchingValues()
Copyright © 2018 Singular Systems http://www.singularsys.com/jep