|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rpgee.utility.BaseObservable<T>
public class BaseObservable<T>
Field Summary |
---|
Fields inherited from interface net.sourceforge.rpgee.Identified |
---|
ID |
Fields inherited from interface net.sourceforge.rpgee.Named |
---|
NAME |
Constructor Summary | |
---|---|
BaseObservable()
Construct an BaseObservable with zero Observers. |
|
BaseObservable(java.lang.String _id)
|
Method Summary | |
---|---|
void |
addObserver(Observer o)
Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set. |
protected void |
clearChanged()
Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change, so that the hasChanged method will now return false. |
int |
countObservers()
Returns the number of observers of this BaseObservable object. |
void |
deleteObserver(Observer o)
Deletes an observer from the set of observers of this object. |
void |
deleteObservers()
Clears the observer list so that this object no longer has any observers. |
java.lang.String |
getId()
|
java.lang.String |
getIdAsString()
|
java.lang.String |
getName()
|
boolean |
hasChanged()
Tests if this object has changed. |
void |
notifyObservers()
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then
call the clearChanged method to indicate that this object has no longer changed. |
void |
notifyObservers(T arg)
If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then
call the clearChanged method to indicate that this object has no longer changed. |
protected void |
setChanged()
Marks this BaseObservable object as having been changed; the hasChanged method will now return true. |
void |
setId(java.lang.String _id)
|
protected void |
setName(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseObservable()
public BaseObservable(java.lang.String _id)
Method Detail |
---|
public void addObserver(Observer o)
Observable
addObserver
in interface Observable<T>
o
- an observer to be added.public void deleteObserver(Observer o)
Observable
null
to this method will have no effect.
deleteObserver
in interface Observable<T>
o
- the observer to be deleted.public void notifyObservers() throws java.lang.Exception
Observable
hasChanged
method, then notify all of its observers and then
call the clearChanged
method to indicate that this object has no longer changed.
Each observer has its update
method called with two arguments: this observable object and null
.
In other words, this method is equivalent to:
notifyObservers(null)
notifyObservers
in interface Observable<T>
java.lang.Exception
Observable.clearChanged()
,
Observable.hasChanged()
,
Observer.update(java.util.Observable, java.lang.Object)
public void notifyObservers(T arg) throws java.lang.Exception
Observable
hasChanged
method, then notify all of its observers and then
call the clearChanged
method to indicate that this object has no longer changed.
Each observer has its update
method called with two arguments: this observable object and the arg
argument.
notifyObservers
in interface Observable<T>
arg
- any object.
java.lang.Exception
Observable.clearChanged()
,
Observable.hasChanged()
,
Observer.update(java.util.Observable, java.lang.Object)
public void deleteObservers()
Observable
deleteObservers
in interface Observable<T>
protected void setChanged()
protected void clearChanged()
notifyObservers
methods.
Observable.notifyObservers()
,
Observable.notifyObservers(java.lang.Object)
public boolean hasChanged()
Observable
hasChanged
in interface Observable<T>
true
if and only if the setChanged
method has been called more recently than the
clearChanged
method on this object; false
otherwise.Observable.clearChanged()
,
Observable.setChanged()
public int countObservers()
Observable
countObservers
in interface Observable<T>
public java.lang.String getId()
getId
in interface Identified<java.lang.String>
public java.lang.String getIdAsString()
getIdAsString
in interface Identified<java.lang.String>
public void setId(java.lang.String _id) throws IdentityException
setId
in interface MutableIdentified<java.lang.String>
IdentityException
public java.lang.String getName()
getName
in interface Named
protected void setName(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |