com.artima.place
Class PlaceChangeEvent
java.lang.Object
|
+--java.util.EventObject
|
+--com.artima.place.PlaceChangeEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class PlaceChangeEvent
- extends java.util.EventObject
An event that indicates a change in the contents of a
DynamicPlace. This event will only be fired if at least one
link was altered, added, or removed. A single PlaceChangeEvent
may be used to report multiple alterations, additions, and/or removals.
Each alteration, addition, or removal of a particular
DynamicPlace is reported in one and only one
PlaceChangeEvent.
- See Also:
- Serialized Form
| Fields inherited from class java.util.EventObject |
source |
|
Constructor Summary |
PlaceChangeEvent(DynamicPlace source,
java.lang.Object[] keysAltered,
java.lang.Object[] keysAdded,
java.lang.Object[] keysRemoved)
Constructs a PlaceChangeEvent object with the specified
keys altered, added, and removed. |
|
Method Summary |
java.lang.Object[] |
getKeysAdded()
Returns an array of Object keys for those links that have
been added. |
java.lang.Object[] |
getKeysAltered()
Returns an array of Object keys for those links that have
been altered. |
java.lang.Object[] |
getKeysRemoved()
Returns an array of Object keys for those links that have
been removed. |
int |
getType()
Returns a bitwise OR of all the types of key change events
reported by this PlaceChangeEvent, where the three
types are PlaceChangeEvent.KEYS_ALTERED, PlaceChangeEvent.KEYS_ADDED, and
PlaceChangeEvent.KEYS_REMOVED. |
| Methods inherited from class java.util.EventObject |
getSource, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
KEYS_ALTERED
public static final int KEYS_ALTERED
KEYS_ADDED
public static final int KEYS_ADDED
KEYS_REMOVED
public static final int KEYS_REMOVED
PlaceChangeEvent
public PlaceChangeEvent(DynamicPlace source,
java.lang.Object[] keysAltered,
java.lang.Object[] keysAdded,
java.lang.Object[] keysRemoved)
- Constructs a
PlaceChangeEvent object with the specified
keys altered, added, and removed. To indicate that no values have been
altered (or added, or removed), either an empty Object
array or a null reference must be passed in the
keysAltered (or keysAdded or
keysRemoved) parameter.
- Parameters:
source - the source of this PlaceChangeEventkeysAltered - an array of keys whose LinkItem values
have been alteredkeysAdded - an array of keys associated with
LinkItem values that have been addedkeysRemoved - an array of keys associated with
LinkItem values that have been removed- Throws:
NullPointerException - if passed source is
null
getType
public int getType()
- Returns a bitwise OR of all the types of key change events
reported by this
PlaceChangeEvent, where the three
types are PlaceChangeEvent.KEYS_ALTERED, PlaceChangeEvent.KEYS_ADDED, and
PlaceChangeEvent.KEYS_REMOVED.
getKeysAltered
public java.lang.Object[] getKeysAltered()
- Returns an array of
Object keys for those links that have
been altered. A link is "altered" if a value for that key already
existed in the Place, and the value was altered or
replaced a new value. If no links have been altered since the previous
PlaceChangeEvent was propagated (or since the
DynamicPlace was sent to the client if this is the
first PlaceChangeEvent propagated), this method returns an
empty Object array. This method never returns
null.
- Returns:
- the array of altered keys
getKeysAdded
public java.lang.Object[] getKeysAdded()
- Returns an array of
Object keys for those links that have
been added. A link is "added" if the key for a newly added
LinkItem value did not previously exist in the
Place. If no links have been added since the previous
PlaceChangeEvent was propagated (or since the
DynamicPlace was sent to the client if this is the
first PlaceChangeEvent propagated), this method returns an
empty Object array. This method never returns
null.
- Returns:
- the array of added keys
getKeysRemoved
public java.lang.Object[] getKeysRemoved()
- Returns an array of
Object keys for those links that have
been removed. A link is "removed" if its key previously existed in the
Place, but now does not. If no links have been removed
since the previous PlaceChangeEvent was propagated (or since
the DynamicPlace was sent to the client if this is the
first PlaceChangeEvent propagated), this method returns an
empty Object array. This method never returns
null.
- Returns:
- the array of removed keys