Class FWObservable

java.lang.Object
net.simplace.core.FWObservable

public class FWObservable extends Object
Author:
Andreas Enders
  • Constructor Details

    • FWObservable

      public FWObservable(Map<String,Object> aFormInputParameterMap, FWAbstractFunctionality aFormFunctionality)
      Parameters:
      aFormInputParameterMap -
      aFormFunctionality -
    • FWObservable

      public FWObservable()
      Parameters:
      aParameterMap -
  • Method Details

    • addObserver

      public void addObserver(FWObserver aObserver)
      Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set. The order in which notifications will be delivered to multiple observers is not specified. See the class comment.
      Parameters:
      aObserver -
      o - an observer to be added.
      Throws:
      NullPointerException - if the parameter o is null.
    • getParameterMap

      public Map<String,Object> getParameterMap()
      Returns:
      the parameterMap
    • getStringParameterValue

      public String getStringParameterValue(String aKey)
      Parameters:
      aKey -
      Returns:
      one parameter value for given key - null if key was not set
    • getIntegerParameterValue

      public Integer getIntegerParameterValue(String aKey)
      Parameters:
      aKey -
      Returns:
      one parameter converted to Integer value for given key - null if key was not set or value not convertible
    • getDoubleParameterValue

      public Double getDoubleParameterValue(String aKey)
      Parameters:
      aKey -
      Returns:
      one parameter converted to Double value for given key - null if key was not set or value not convertible
    • replaceParamTokens

      public String replaceParamTokens(String aString, Object aDefault)
      replaces Parameters
      Parameters:
      aString -
      aDefault -
      Returns:
      aNewValue
    • replaceParamTokens

      public String replaceParamTokens(String aString, Object aDefault, boolean aIgnoreNull)
      replaces Parameters
      Parameters:
      aString -
      aDefault -
      aIgnoreNull -
      Returns:
      aNewValue
    • getParameter

      public Object getParameter(String aKey)
      Parameters:
      aKey -
      Returns:
      parameter by aKey
    • getParameter

      public Object getParameter(String aKey, Object aDefault)
      Parameters:
      aKey -
      aDefault -
      Returns:
      parameter by aKey or default value
    • setParameterValue

      public void setParameterValue(String aKey, Object aValue)
      Parameters:
      aKey -
      aValue -
    • setParameterValue

      public void setParameterValue(String aKey, Object aValue, boolean aShouldNotify)
      Parameters:
      aKey -
      aValue -
      aShouldNotify -
    • getSystemID

      public String getSystemID()
      Returns:
      Identifier of this Functionality
    • notifyObservers

      public void notifyObservers()
      If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.

      Each observer has its update method called with two arguments: this observable object and null. In other words, this method is equivalent to:

      notifyObservers(null)
      See Also:
    • notifyObservers

      public void notifyObservers(Object arg)
      If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed.

      Each observer has its update method called with two arguments: this observable object and the arg argument.

      Parameters:
      arg - any object.
      See Also:
    • setChanged

      protected void setChanged()
      Marks this Observable object as having been changed; the hasChanged method will now return true.
    • clearChanged

      protected void clearChanged()
      Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change, so that the hasChanged method will now return false. This method is called automatically by the notifyObservers methods.
      See Also:
    • hasChanged

      public boolean hasChanged()
      Tests if this object has changed.
      Returns:
      true if and only if the setChanged method has been called more recently than the clearChanged method on this object; false otherwise.
      See Also:
    • countObservers

      public int countObservers()
      Returns the number of observers of this Observable object.
      Returns:
      the number of observers of this object.
    • getFunctionality

      public FWAbstractFunctionality getFunctionality()
      Returns the number of observers of this Observable object.
      Returns:
      the number of observers of this object.
    • clone

      public FWObservable clone()
      Returns the number of observers of this Observable object.
      Overrides:
      clone in class Object
      Returns:
      the number of observers of this object.
    • getBooleanParameterValue

      public boolean getBooleanParameterValue(String aParamKey, boolean aDefault)
      Parameters:
      aParamKey -
      aDefault -
      Returns:
      boolean parameter value
    • removeParameter

      public void removeParameter(String aElement)
      Parameters:
      aElement -
    • putAllParameters

      public void putAllParameters(Map<String,Object> aParamMap)
      Parameters:
      aParamMap -
    • isParameterSet

      public boolean isParameterSet(String aKey)
      Parameters:
      aKey -
      Returns:
      true, is the parameter is set, otherwise returns false
    • toString

      public String toString()
      Overrides:
      toString in class Object