Value - public class SimplePushMeasure<Value> extends SimpleMeasure<Value> implements PushMeasure<Value>
SimplePushMeasure is a basic implementation of PushMeasure.
As a PushMeasure, it is intended to be fed by the algorithm while
external entities should use register(MeasureListener) to be
notified in real time. For the algorithm to feed it, it should provide a
solution and its value to #push(Object, Object), leading to the
notification of the registered observers.| Constructor and Description |
|---|
SimplePushMeasure()
Create a
SimplePushMeasure with the class name as its name and a
null description. |
SimplePushMeasure(String name)
Create a
SimplePushMeasure with a given name and a
null description. |
SimplePushMeasure(String name,
String description)
Create a
SimplePushMeasure with a given name and a given
description. |
| Modifier and Type | Method and Description |
|---|---|
void |
push(Value value)
Notify the observers which has registered a
MeasureListener
through register(MeasureListener) about a value. |
void |
register(MeasureListener<Value> listener)
|
void |
unregister(MeasureListener<Value> listener)
Unregister a
MeasureListener registered with
PushMeasure.register(MeasureListener) to stop receiving the notifications of
the PushMeasure. |
getDescription, getName, setDescription, setName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDescription, getNamepublic SimplePushMeasure(String name, String description)
SimplePushMeasure with a given name and a given
description.public SimplePushMeasure(String name)
SimplePushMeasure with a given name and a
null description.name - the name of the Measurepublic SimplePushMeasure()
SimplePushMeasure with the class name as its name and a
null description.public void register(MeasureListener<Value> listener)
PushMeasureregister in interface PushMeasure<Value>listener - the MeasureListener to registerpublic void unregister(MeasureListener<Value> listener)
PushMeasureMeasureListener registered with
PushMeasure.register(MeasureListener) to stop receiving the notifications of
the PushMeasure.unregister in interface PushMeasure<Value>listener - the MeasureListener to unregisterpublic void push(Value value)
MeasureListener
through register(MeasureListener) about a value.value - the value to send to the observersCopyright © 2017. All rights reserved.