Package net.simplace.core
Class FWObservable
java.lang.Object
net.simplace.core.FWObservable
- Author:
- Andreas Enders
-
Constructor Summary
ConstructorDescriptionFWObservable
(Map<String, Object> aFormInputParameterMap, FWAbstractFunctionality aFormFunctionality) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.protected void
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.clone()
Returns the number of observers of this Observable object.int
Returns the number of observers of this Observable object.boolean
getBooleanParameterValue
(String aParamKey, boolean aDefault) Returns the number of observers of this Observable object.getParameter
(String aKey) getParameter
(String aKey, Object aDefault) boolean
Tests if this object has changed.boolean
isParameterSet
(String aKey) void
If this object has changed, as indicated by thehasChanged
method, then notify all of its observers and then call theclearChanged
method to indicate that this object has no longer changed.void
notifyObservers
(Object arg) If this object has changed, as indicated by thehasChanged
method, then notify all of its observers and then call theclearChanged
method to indicate that this object has no longer changed.void
putAllParameters
(Map<String, Object> aParamMap) void
removeParameter
(String aElement) replaceParamTokens
(String aString, Object aDefault) replaces ParametersreplaceParamTokens
(String aString, Object aDefault, boolean aIgnoreNull) replaces Parametersprotected void
Marks this Observable object as having been changed; the hasChanged method will now return true.void
setParameterValue
(String aKey, Object aValue) void
setParameterValue
(String aKey, Object aValue, boolean aShouldNotify) toString()
-
Constructor Details
-
FWObservable
public FWObservable(Map<String, Object> aFormInputParameterMap, FWAbstractFunctionality aFormFunctionality) - Parameters:
aFormInputParameterMap
-aFormFunctionality
-
-
FWObservable
public FWObservable()- Parameters:
aParameterMap
-
-
-
Method Details
-
addObserver
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
- Returns:
- the parameterMap
-
getStringParameterValue
- Parameters:
aKey
-- Returns:
- one parameter value for given key - null if key was not set
-
getIntegerParameterValue
- Parameters:
aKey
-- Returns:
- one parameter converted to Integer value for given key - null if key was not set or value not convertible
-
getDoubleParameterValue
- Parameters:
aKey
-- Returns:
- one parameter converted to Double value for given key - null if key was not set or value not convertible
-
replaceParamTokens
replaces Parameters- Parameters:
aString
-aDefault
-- Returns:
- aNewValue
-
replaceParamTokens
replaces Parameters- Parameters:
aString
-aDefault
-aIgnoreNull
-- Returns:
- aNewValue
-
getParameter
- Parameters:
aKey
-- Returns:
- parameter by aKey
-
getParameter
- Parameters:
aKey
-aDefault
-- Returns:
- parameter by aKey or default value
-
setParameterValue
- Parameters:
aKey
-aValue
-
-
setParameterValue
- Parameters:
aKey
-aValue
-aShouldNotify
-
-
getSystemID
- Returns:
- Identifier of this Functionality
-
notifyObservers
public void notifyObservers()If this object has changed, as indicated by thehasChanged
method, then notify all of its observers and then call theclearChanged
method to indicate that this object has no longer changed.Each observer has its
update
method called with two arguments: this observable object andnull
. In other words, this method is equivalent to:notifyObservers(null)
-
notifyObservers
If this object has changed, as indicated by thehasChanged
method, then notify all of its observers and then call theclearChanged
method to indicate that this object has no longer changed.Each observer has its
update
method called with two arguments: this observable object and thearg
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 thenotifyObservers
methods. -
hasChanged
public boolean hasChanged()Tests if this object has changed.- Returns:
true
if and only if thesetChanged
method has been called more recently than theclearChanged
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
Returns the number of observers of this Observable object.- Returns:
- the number of observers of this object.
-
clone
Returns the number of observers of this Observable object. -
getBooleanParameterValue
- Parameters:
aParamKey
-aDefault
-- Returns:
- boolean parameter value
-
removeParameter
- Parameters:
aElement
-
-
putAllParameters
- Parameters:
aParamMap
-
-
isParameterSet
- Parameters:
aKey
-- Returns:
- true, is the parameter is set, otherwise returns false
-
toString
-