Documentation of 'com.jstatcom.model.JSCDataEvent' Java class
JSCDataEvent
com.jstatcom.model

Class JSCDataEvent



  • public class JSCDataEvent
    extends java.lang.Object
    Events of this type are fired by JSCData objects to notify listeners like JSCSymbol objects about changes of various kinds. Instances of this class are constructed via the static valueOf factory methods.

    Usage Note:
    The events that are fired by the JSCData objects are intended for internal communication only. Events do not occur in the EventDispatchingThread. Clients should rather listen to changes in JSCSymbol objects, especially if GUI related actions are performed.

    • Constructor Detail

      • JSCDataEvent

        public JSCDataEvent(JSCData source,
                            JSCDataEventTypes type,
                            java.lang.Object oldValue,
                            java.lang.Object newValue)
        Creates a JSCDataEvent.
        Parameters:
        source - the source data object
        type - the type of this event
        oldValue - the value before the change
        newValue - 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 JSCData object
      • 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:
        toString in class java.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 type JSCDataEventTypes.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
      • valueOfEmptyState

        public static JSCDataEvent valueOfEmptyState(JSCData source,
                                                     boolean isEmptyNow)
        Gets an instance of this for events of type JSCDataEventTypes.EMPTY_STATE.
        Parameters:
        source - the source from which the event is fired
        isEmptyNow - true if source is empty
        Returns:
        a cleared event
      • 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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.