Package it.tidalwave.role.ui.function
Class WeakCopyFunctionSupport<T>
- java.lang.Object
-
- it.tidalwave.role.ui.function.BoundFunctionSupport<DOMAIN_TYPE,CODOMAIN_TYPE>
-
- it.tidalwave.role.ui.function.UnaryBoundFunctionSupport<T,T>
-
- it.tidalwave.role.ui.function.WeakCopyFunctionSupport<T>
-
- All Implemented Interfaces:
Changeable<T>
,ChangingSource<T>
,BoundFunction<T,T>
- Direct Known Subclasses:
CopyIfEmptyOrConform
public abstract class WeakCopyFunctionSupport<T> extends UnaryBoundFunctionSupport<T,T> implements Changeable<T>
Changes the destination only at a certain condition in function of the target.- Author:
- Fabrizio Giudici
-
-
Field Summary
Fields Modifier and Type Field Description protected T
targetValue
-
Fields inherited from class it.tidalwave.role.ui.function.UnaryBoundFunctionSupport
source, value
-
-
Constructor Summary
Constructors Constructor Description WeakCopyFunctionSupport(ChangingSource<T> source)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected T
function(T value)
protected void
onSourceChange(T oldSourceValue, T newSourceValue)
void
set(T value)
Sets a new value to this object.protected abstract boolean
shouldChange(T oldValue, T newValue)
-
Methods inherited from class it.tidalwave.role.ui.function.UnaryBoundFunctionSupport
get
-
Methods inherited from class it.tidalwave.role.ui.function.BoundFunctionSupport
fireValueChanged, fireValueChanged, unbindAll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.tidalwave.role.ui.ChangingSource
addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener
-
-
-
-
Field Detail
-
targetValue
@Nonnull protected T targetValue
-
-
Constructor Detail
-
WeakCopyFunctionSupport
public WeakCopyFunctionSupport(@Nonnull ChangingSource<T> source)
-
-
Method Detail
-
onSourceChange
protected void onSourceChange(@Nonnull T oldSourceValue, @Nonnull T newSourceValue)
- Overrides:
onSourceChange
in classUnaryBoundFunctionSupport<T,T>
-
set
public void set(T value)
Description copied from interface:Changeable
Sets a new value to this object.- Specified by:
set
in interfaceChangeable<T>
- Parameters:
value
- the new value
-
-