|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.dobj.DEvent
com.threerings.presents.dobj.NamedEvent
com.threerings.presents.dobj.ElementUpdatedEvent
public class ElementUpdatedEvent
An element updated event is dispatched when an element of an array field in a distributed object is updated. It can also be constructed to request the update of an entry and posted to the dobjmgr.
DObjectManager.postEvent(com.threerings.presents.dobj.DEvent)| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected int |
_index
|
protected Object |
_oldValue
|
protected Object |
_value
|
| Fields inherited from class com.threerings.presents.dobj.NamedEvent |
|---|
_name |
| Fields inherited from class com.threerings.presents.dobj.DEvent |
|---|
_actualTransport, _soid, _toid, _transport, eventId, UNSET_OLD_ENTRY, UNSET_OLD_VALUE |
| Constructor Summary | |
|---|---|
ElementUpdatedEvent()
For unserialization. |
|
ElementUpdatedEvent(int targetOid,
String name,
Object value,
int index)
Constructs a new element updated event on the specified target object with the supplied attribute name, element and index. |
|
| Method Summary | |
|---|---|
boolean |
alreadyApplied()
If this event applies itself immediately to the distributed object on the server and then NOOPs later when DEvent.applyToObject(com.threerings.presents.dobj.DObject) is called, it should return true from this method. |
boolean |
applyToObject(DObject target)
Applies the attribute modifications represented by this event to the specified target object. |
double |
getDoubleValue()
Returns the new value of the element as a double. |
float |
getFloatValue()
Returns the new value of the element as a float. |
int |
getIndex()
Returns the index of the element. |
int |
getIntValue()
Returns the new value of the element as an int. |
long |
getLongValue()
Returns the new value of the element as a long. |
Object |
getOldValue()
Returns the value of the element prior to the application of this event. |
short |
getShortValue()
Returns the new value of the element as a short. |
Object |
getValue()
Returns the new value of the element. |
protected void |
notifyListener(Object listener)
Events with associated listener interfaces should implement this function and notify the supplied listener if it implements their event listening interface. |
protected ElementUpdatedEvent |
setOldValue(Object oldValue)
|
protected void |
toString(StringBuilder buf)
This should be overridden by derived classes (which should be sure to call super.toString()) to append the derived class specific event information to the
string buffer. |
| Methods inherited from class com.threerings.presents.dobj.NamedEvent |
|---|
getName |
| Methods inherited from class com.threerings.presents.dobj.DEvent |
|---|
getActualTransport, getSourceOid, getTargetOid, getTransport, isPrivate, noteActualTransport, setSourceOid, setTargetOid, setTransport, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Object _value
protected int _index
protected transient Object _oldValue
| Constructor Detail |
|---|
public ElementUpdatedEvent(int targetOid,
String name,
Object value,
int index)
targetOid - the object id of the object whose attribute has changed.name - the name of the attribute (data member) for which an element has changed.value - the new value of the element (in the case of primitive types, the
reflection-defined object-alternative is used).index - the index in the array of the updated element.public ElementUpdatedEvent()
| Method Detail |
|---|
public Object getValue()
public Object getOldValue()
public int getIndex()
public short getShortValue()
public int getIntValue()
public long getLongValue()
public float getFloatValue()
public double getDoubleValue()
public boolean alreadyApplied()
DEventDEvent.applyToObject(com.threerings.presents.dobj.DObject) is called, it should return true from this method.
If it will modify the object during its DEvent.applyToObject(com.threerings.presents.dobj.DObject) call, it should return false.
alreadyApplied in class DEvent
public boolean applyToObject(DObject target)
throws ObjectAccessException
DEvent
applyToObject in class DEventObjectAccessException - thrown if there is any problem applying the event to the
object (invalid attribute, etc.).protected void notifyListener(Object listener)
DEventAttributeChangedEvent will notify listeners that implement AttributeChangeListener.
notifyListener in class DEventprotected void toString(StringBuilder buf)
DEventsuper.toString()) to append the derived class specific event information to the
string buffer.
toString in class NamedEventprotected ElementUpdatedEvent setOldValue(Object oldValue)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||