Class Value<T>

All Implemented Interfaces:
IEditableModel, IModel, IValue<T>, IValidable
Direct Known Subclasses:
AbstractInfobaseApplicationEditorModel, BmTrendlineArrayModelValue, BmValue, EmfValue, PojoValue, ValueWorkingCopy, ViewModelValue

public abstract class Value<T> extends EditableModel implements IValue<T>
Base IValue implementation.
  • Constructor Details

    • Value

      public Value()
  • Method Details

    • get

      public T get()
      Specified by:
      get in interface IValue<T>
      Returns:
      the stored value.
    • discard

      public void discard()
      Description copied from interface: IModel
      Discards the changes stored in the model buffer since last IModel.commit() operation.
      Specified by:
      discard in interface IModel
      Overrides:
      discard in class Model
    • set

      public void set(T value)
      Specified by:
      set in interface IValue<T>
      Parameters:
      value - the value to set.
    • isEqual

      public boolean isEqual(T other)
      Description copied from interface: IValue
      Checks the value for equality with the current stored value.
      Specified by:
      isEqual in interface IValue<T>
      Parameters:
      other - the other value to check.
      Returns:
      true if other value is equal to this value, false otherwise.
    • addValueListener

      public void addValueListener(IValueListener<T> listener)
      Description copied from interface: IValue
      Adds the value listener.
      Specified by:
      addValueListener in interface IValue<T>
      Parameters:
      listener - the listener to add.
    • removeValueListener

      public void removeValueListener(IValueListener<T> listener)
      Description copied from interface: IValue
      Removes the value listener.
      Specified by:
      removeValueListener in interface IValue<T>
      Parameters:
      listener - the listener to remove.
    • createWorkingCopy

      public Value<T> createWorkingCopy()
      Specified by:
      createWorkingCopy in interface IModel
      Specified by:
      createWorkingCopy in interface IValue<T>
      Overrides:
      createWorkingCopy in class Model
      Returns:
      the model working copy or null if working copies is not supported by the model.
    • dispose

      public void dispose()
      Description copied from interface: IModel
      Disposes this model.
      Specified by:
      dispose in interface IModel
      Overrides:
      dispose in class Model
    • toString

      public String toString()
      Overrides:
      toString in class Model
    • getValidatorTarget

      protected Object getValidatorTarget()
      Description copied from class: Validable
      Provides validation target for this validable object. Override this method to change the validation target of this validable.
      Overrides:
      getValidatorTarget in class Validable
      Returns:
      this object validation target.
    • getCommittedValue

      protected final T getCommittedValue()
      Returns:
      the committed value, under normal conditions it should be in sync with data source.
    • setCommittedValue

      protected final void setCommittedValue(T committedValue)
      Parameters:
      committedValue - the new committed value to set.
      See Also:
    • getUncommittedValue

      protected final T getUncommittedValue()
      Returns:
      the buffered but yet uncommitted value.
    • setUncommittedValue

      protected final void setUncommittedValue(T uncommittedValue)
      Parameters:
      uncommittedValue - the new uncommitted value to set.
    • setValue

      protected final void setValue(T value)
      Sets both the committed and the uncommitted values at the same time.
      Parameters:
      value - the value to set.
    • notifyValueChanged

      protected final void notifyValueChanged(ChangeOrigin changeOrigin)
      Notifies the listeners about a change of this value.
    • queueNotifyValueChanged

      protected final void queueNotifyValueChanged()
      Asynchronously notifies the listeners about a change of this value.