frysk.rt
Class UpdatingDisplayValue

java.lang.Object
  extended by frysk.rt.UpdatingDisplayValue

public class UpdatingDisplayValue
extends Object

An UpdatingDisplayValue is nearly identical to a DisplayValue, except that an UpdatingDisplayValue is provided with additional information that enables it to automatically refresh itself whenever the task given to it changes state. Objects can be notified of updates by using the addObserver method.


Method Summary
 void addObserver(DisplayValueObserver obs)
          Adds an observer to listen for changes to this DisplayValue
 void disable()
          Disables the display, stopping all notification of changes to the underlying expression.
 void enable()
          Re-enables the display, resuming notification of events to all observers
 boolean equals(Object other)
           
 FrameIdentifier getFrameIdentifier()
           
 int getId()
           
 String getName()
           
 Task getTask()
           
 Value getValue()
           
 boolean isAvailable()
           
 boolean isEnabled()
          Check if this display is enabled or not.
 void refresh()
          Updates the display to refect the new variable value
 boolean removeObserver(DisplayValueObserver obs)
          Removes the given observer from the list of observers
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

refresh

public void refresh()
Updates the display to refect the new variable value


addObserver

public void addObserver(DisplayValueObserver obs)
Adds an observer to listen for changes to this DisplayValue

Parameters:
obs - The new observer to be notified

removeObserver

public boolean removeObserver(DisplayValueObserver obs)
Removes the given observer from the list of observers

Parameters:
obs - The observer to remove
Returns:
True if obs was found and removed, false otherwise

equals

public boolean equals(Object other)
Overrides:
equals in class Object

disable

public void disable()
Disables the display, stopping all notification of changes to the underlying expression.


enable

public void enable()
Re-enables the display, resuming notification of events to all observers


isEnabled

public boolean isEnabled()
Check if this display is enabled or not. A disabled display will not send any notifications regarding changes to the value of the watched expression.

Returns:
True iff this display is enabled, false otherwise

isAvailable

public boolean isAvailable()
Returns:
true iff the variable represented by this Display is in scope

getValue

public Value getValue()
Returns:
The Value object encapsulated by this Display.

getFrameIdentifier

public FrameIdentifier getFrameIdentifier()

getTask

public Task getTask()

getName

public String getName()

getId

public int getId()