com.jstatcom.model
Class SymbolEvent

java.lang.Object
  extended by com.jstatcom.model.SymbolEvent

public class SymbolEvent
extends java.lang.Object

Events of this type are fired by Symbol objects to notify listeners about changes of various kinds. Instances of this class are constructed via the static valueOf factory methods.

Author:
Markus Kraetzig

Method Summary
 java.lang.Object getNewValue()
          Gets the value after the change.
 java.lang.Object getOldValue()
          Gets the value before the change.
 Symbol getSource()
          Gets the data object where the event was fired from.
 SymbolEventTypes getType()
          Gets the type of this event.
 boolean isSourceEmpty()
          Gets the value after the change as a boolean.
 java.lang.String toString()
          Gets a string representation of this.
static SymbolEvent valueOfEmptyState(Symbol source, boolean isEmptyNow)
          Gets an instance of this for events of type SymbolEventTypes.EMPTY_STATE.
static SymbolEvent valueOfJSCDataEvent(Symbol source, JSCDataEvent evt)
          Gets an instance of this for events of type JSCDataEvent.
static SymbolEvent valueOfValChanged(Symbol source, java.lang.Object oldValue, java.lang.Object newValue)
          Gets an instance of this for events of type SymbolEventTypes.VALUE_CHANGED.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getNewValue

public final java.lang.Object getNewValue()
Gets the value after the change.

Returns:
an arbitrary object

isSourceEmpty

public final boolean isSourceEmpty()
Gets the value after the change as a boolean.

Returns:
true if new value is a Boolean that is true, false otherwise

getOldValue

public final java.lang.Object getOldValue()
Gets the value before the change.

Returns:
an arbitrary object

getSource

public final Symbol getSource()
Gets the data object where the event was fired from.

Returns:
a Symbol object

getType

public final SymbolEventTypes getType()
Gets the type of this event.

Returns:
one of SymbolEventTypes

toString

public java.lang.String toString()
Gets a string representation of this.

Overrides:
toString in class java.lang.Object
Returns:
informative string representation

valueOfEmptyState

public static SymbolEvent valueOfEmptyState(Symbol source,
                                            boolean isEmptyNow)
Gets an instance of this for events of type SymbolEventTypes.EMPTY_STATE.

Parameters:
source - the source from which the event is fired
isEmptyNow - true if source is empty
Returns:
a cleared event

valueOfJSCDataEvent

public static SymbolEvent valueOfJSCDataEvent(Symbol source,
                                              JSCDataEvent evt)
Gets an instance of this for events of type JSCDataEvent. This method translates a JSCDataEvent into a SymbolEvent.

Parameters:
source - the source from which the event is fired
evt - the JSCDataEvent to be translated to a SymbolEvent
Returns:
a symbol event

valueOfValChanged

public static SymbolEvent valueOfValChanged(Symbol source,
                                            java.lang.Object oldValue,
                                            java.lang.Object newValue)
Gets an instance of this for events of type SymbolEventTypes.VALUE_CHANGED.

Parameters:
source - the source from which the event is fired
oldValue - the value before the change
newValue - the value after the change
Returns:
a changed event