com.jstatcom.model
Class JSCDataEvent
- java.lang.Object
-
- com.jstatcom.model.JSCDataEvent
-
public class JSCDataEvent extends java.lang.ObjectEvents of this type are fired byJSCDataobjects to notify listeners likeJSCSymbolobjects about changes of various kinds. Instances of this class are constructed via the staticvalueOffactory methods.Usage Note:
The events that are fired by theJSCDataobjects are intended for internal communication only. Events do not occur in theEventDispatchingThread. Clients should rather listen to changes inJSCSymbolobjects, especially if GUI related actions are performed.
-
-
Constructor Summary
Constructors Constructor and Description JSCDataEvent(JSCData source, JSCDataEventTypes type, java.lang.Object oldValue, java.lang.Object newValue)Creates aJSCDataEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.ObjectgetNewValue()Gets the value after the change.java.lang.ObjectgetOldValue()Gets the value before the change.JSCDatagetSource()Gets the data object where the event was fired from.JSCDataEventTypesgetType()Gets the type of this event.booleanisSourceEmpty()Gets the value after the change as aboolean.java.lang.StringtoString()Gets a string representation of this.static JSCDataEventvalueOfChanged(JSCData source, java.lang.Object oldValue, java.lang.Object newValue)Gets an instance of this for events of typeJSCDataEventTypes.VALUE_CHANGED.static JSCDataEventvalueOfEmptyState(JSCData source, boolean isEmptyNow)Gets an instance of this for events of typeJSCDataEventTypes.EMPTY_STATE.
-
-
-
Constructor Detail
-
JSCDataEvent
public JSCDataEvent(JSCData source, JSCDataEventTypes type, java.lang.Object oldValue, java.lang.Object newValue)
Creates aJSCDataEvent.- Parameters:
source- the source data objecttype- the type of this eventoldValue- the value before the changenewValue- the value after the change
-
-
Method Detail
-
getNewValue
public final java.lang.Object getNewValue()
Gets the value after the change.- Returns:
- an arbitrary object
-
getOldValue
public final java.lang.Object getOldValue()
Gets the value before the change.- Returns:
- an arbitrary object
-
getSource
public final JSCData getSource()
Gets the data object where the event was fired from.- Returns:
- a
JSCDataobject
-
getType
public final JSCDataEventTypes getType()
Gets the type of this event.- Returns:
- one of
JSCDataEventTypes
-
toString
public java.lang.String toString()
Gets a string representation of this.- Overrides:
toStringin classjava.lang.Object- Returns:
- informative string representation
-
valueOfChanged
public static JSCDataEvent valueOfChanged(JSCData source, java.lang.Object oldValue, java.lang.Object newValue)
Gets an instance of this for events of typeJSCDataEventTypes.VALUE_CHANGED.- Parameters:
source- the source from which the event is firedoldValue- the value before the changenewValue- the value after the change- Returns:
- a changed event
-
valueOfEmptyState
public static JSCDataEvent valueOfEmptyState(JSCData source, boolean isEmptyNow)
Gets an instance of this for events of typeJSCDataEventTypes.EMPTY_STATE.- Parameters:
source- the source from which the event is firedisEmptyNow-trueif source is empty- Returns:
- a cleared event
-
isSourceEmpty
public final boolean isSourceEmpty()
Gets the value after the change as aboolean.- Returns:
trueif new value is aBooleanthat is true,falseotherwise
-
-
DMelt 3.0 © DataMelt by jWork.ORG