Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.singularsys.jep.misc
Class VariableTableObserver

    java.lang.Object
      com.singularsys.jep.misc.VariableTableObserver

All Implemented Interfaces:
  java.util.Observer

    public class VariableTableObserver

extends java.lang.Object
implements java.util.Observer

Base class for observing Variables and the VariableTable. The methods variableValueChanged(), variableAdded(), variableRemoved(), tableCleared() will be called when these events occur. These methods can be overridden to provide appropriate behaviour, the default action is just to print the a message.

Results are unpredictable if two variable tables are observed using the same object.

Constructor Summary
`VariableTableObserver(Jep jep)`
`VariableTableObserver(VariableTable vt)`

Method Summary
`void` | `addObserver(java.util.Observable obs)`
`void` | `addObservers(VariableTable vt)`
`void` | `deleteObserver(java.util.Observable obs)`
`void` | `deleteObservers()` Stop observing all variables.
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### VariableTableObserver

    public VariableTableObserver(VariableTable vt)

### VariableTableObserver

    public VariableTableObserver(Jep jep)

Method Detail

### addObserver

    public void addObserver(java.util.Observable obs)

### addObservers

    public void addObservers(VariableTable vt)

### deleteObserver

    public void deleteObserver(java.util.Observable obs)

### deleteObservers

    public void deleteObservers()

  Stop observing all variables.

### update

    public void update(java.util.Observable o,
                       java.lang.Object arg)

  Called when the Observable.notifyObservers() method is called. This methods calls the variableAdded(), variableValueChanged() etc. methods and maintains the list of variables it is observing.

  Specified by:
    `update` in interface `java.util.Observer`

### variableChanged

    protected void variableChanged(Variable var)

  Called when a variable value has changed. Intended to be overridden by subclasses.

  Parameters:
    `var` - the variable which has changed.

### variableAdded

    protected void variableAdded(Variable var)

  Called when a variable is added to the table. Intended to be overridden by subclasses.

  Parameters:
    `var` - the variable which has been added.

### variableRemoved

    protected void variableRemoved(Variable var)

  Called when a variable is removed from the table. Intended to be overridden by subclasses.

  Parameters:
    `var` - the variable which has been removed.

### tableCleared

    protected void tableCleared(VariableTable table)

  Called when the variable table has been cleared. Intended to be overridden by subclasses.

  Parameters:
    `table` - table which has been cleared

### iterator

    public java.util.Iterator<java.util.Observable> iterator()

  Returns a list of items this class is observing.

  Returns:
    an iterator for the list.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 Singular Systems http://www.singularsys.com/jep