|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object frysk.rt.DisplayValue frysk.rt.UpdatingDisplayValue
public class UpdatingDisplayValue
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.
Nested Class Summary | |
---|---|
private class |
UpdatingDisplayValue.LockObserver
|
private class |
UpdatingDisplayValue.TermObserver
|
Field Summary | |
---|---|
private boolean |
enabled
|
private SteppingEngine |
engine
|
private UpdatingDisplayValue.LockObserver |
lock
|
private List |
observers
|
private byte[] |
oldValue
|
private UpdatingDisplayValue.TermObserver |
term
|
Fields inherited from class frysk.rt.DisplayValue |
---|
frameIdentifier, myTask, myVar, num, varLabel |
Constructor Summary | |
---|---|
UpdatingDisplayValue(String name,
Task task,
FrameIdentifier fIdent,
SteppingEngine eng,
int id)
Crate a new UpdatingDisplayValue |
Method Summary | |
---|---|
void |
addObserver(DisplayValueObserver obs)
Adds an observer to listen for changes to this DisplayValue |
protected boolean |
arrayChanged(byte[] newArray)
|
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)
|
boolean |
isEnabled()
Check if this display is enabled or not. |
protected void |
notifyObserversAvailable()
|
protected void |
notifyObserversDisabled()
|
protected void |
notifyObserversUnavailableOutOfScope()
|
protected void |
notifyObserversUnavailableTaskResumed()
|
protected void |
notifyObserversValueChanged()
|
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 frysk.rt.DisplayValue |
---|
getFrameIdentifier, getId, getName, getTask, getValue, isAvailable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SteppingEngine engine
private List observers
private byte[] oldValue
private UpdatingDisplayValue.LockObserver lock
private UpdatingDisplayValue.TermObserver term
private boolean enabled
Constructor Detail |
---|
UpdatingDisplayValue(String name, Task task, FrameIdentifier fIdent, SteppingEngine eng, int id)
name
- The name of the variable to tracktask
- The task from which to track the variablefIdent
- The frame identifier corresponding to the scope from
which the variable should be readeng
- The stepping engine to monitor for changes in
execution stateid
- The unique id for this displayMethod Detail |
---|
public void refresh()
DisplayValue
refresh
in class DisplayValue
public void addObserver(DisplayValueObserver obs)
obs
- The new observer to be notifiedpublic boolean removeObserver(DisplayValueObserver obs)
obs
- The observer to remove
public boolean equals(Object other)
equals
in class Object
public void disable()
public void enable()
public boolean isEnabled()
protected void notifyObserversAvailable()
protected void notifyObserversUnavailableTaskResumed()
protected void notifyObserversValueChanged()
protected void notifyObserversUnavailableOutOfScope()
protected void notifyObserversDisabled()
protected boolean arrayChanged(byte[] newArray)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |