Package de.gsi.dataset.spi
Class DefaultAxisDescription
- java.lang.Object
-
- de.gsi.dataset.spi.DataRange
-
- de.gsi.dataset.spi.DefaultAxisDescription
-
- All Implemented Interfaces:
AxisDescription,EventSource,java.io.Serializable
public class DefaultAxisDescription extends DataRange implements AxisDescription
Simple default implementation of the AxisDescription interface- Author:
- rstein
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultAxisDescription(int dimIndex)default constructorDefaultAxisDescription(int dimIndex, java.lang.String axisName, java.lang.String... axisUnit)DefaultAxisDescription(int dimIndex, java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)DefaultAxisDescription(AxisDescription axisDesc)Copy constructor to generate axisDescriptions for datasets from existing Axis Descriptions
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(double value)Adds value to this range.booleanadd(double[] values, int length)Adds values to this range.java.util.concurrent.atomic.AtomicBooleanautoNotification()Set the automatic notification of invalidation listeners.booleanequals(java.lang.Object obj)booleanequals(java.lang.Object obj, double epsilon)intgetDimIndex()doublegetMax()doublegetMin()java.lang.StringgetName()java.lang.StringgetUnit()inthashCode()booleanset(double min, double max)Setsminandmaxvalues for this range.booleanset(DataRange range)Sets updates range to the specified one.booleanset(java.lang.String axisName, java.lang.String... axisUnit)booleanset(java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)booleansetMax(double max)Setsmaxvalue for this range.booleansetMin(double min)Setsminvalue for this range.java.lang.StringtoString()java.util.List<EventListener>updateEventListener()-
Methods inherited from class de.gsi.dataset.spi.DataRange
add, add, clear, contains, getLength, isDefined, isMaxDefined, isMinDefined
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.AxisDescription
add, clear, contains, getLength, isDefined, set
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener
-
-
-
-
Constructor Detail
-
DefaultAxisDescription
public DefaultAxisDescription(int dimIndex)
default constructor- Parameters:
dimIndex- numeric dimension index this AxisDescription refers to (e.g. for a euclidean system '0: x-axis', '1: y-axis', ...)
-
DefaultAxisDescription
public DefaultAxisDescription(AxisDescription axisDesc)
Copy constructor to generate axisDescriptions for datasets from existing Axis Descriptions- Parameters:
axisDesc- axis Description to copy all data except dataSet from
-
DefaultAxisDescription
public DefaultAxisDescription(int dimIndex, java.lang.String axisName, java.lang.String... axisUnit)- Parameters:
dimIndex- numeric dimension index this AxisDescription refers to (e.g. for a euclidean system '0: x-axis', '1: y-axis', ...)axisName- the new axis nameaxisUnit- the new axis unit
-
DefaultAxisDescription
public DefaultAxisDescription(int dimIndex, java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)- Parameters:
dimIndex- numeric dimension index this AxisDescription refers to (e.g. for a euclidean system '0: x-axis', '1: y-axis', ...)axisName- the new axis nameaxisUnit- the new axis unitrangeMin- the user-provided new minimum value of the DataSet/Axis rangerangeMax- the user-provided new maximum value of the DataSet/Axis range
-
-
Method Detail
-
add
public boolean add(double value)
Adds value to this range.- Specified by:
addin interfaceAxisDescription- Overrides:
addin classDataRange- Parameters:
value- value to be added- Returns:
trueif the value becomesminormax.
-
add
public boolean add(double[] values, int length)Adds values to this range.- Specified by:
addin interfaceAxisDescription- Overrides:
addin classDataRange- Parameters:
values- values to be addedlength- the maximum array length that should be taken into account- Returns:
trueif the value becomesminormax.
-
autoNotification
public java.util.concurrent.atomic.AtomicBoolean autoNotification()
Description copied from interface:EventSourceSet the automatic notification of invalidation listeners. In general, data sets should notify registered invalidation listeners, if the data in the data set has changed. Charts usually register an invalidation listener with the data set to be notified of any changes and update the charts. Setting the automatic notification to false, allows applications to prevent this behaviour, in case data sets are updated multiple times during an acquisition cycle but the chart update is only required at the end of the cycle.truefor automatic notification- Specified by:
autoNotificationin interfaceEventSource- Returns:
- the atomic boolean
-
equals
public boolean equals(java.lang.Object obj, double epsilon)- Parameters:
obj- object to compare toepsilon- allow for fuzzy comparisons of min/max- Returns:
- true: matches, false otherwise
-
getDimIndex
public final int getDimIndex()
- Specified by:
getDimIndexin interfaceAxisDescription- Returns:
- numeric dimension index this AxisDescription refers to (e.g. for a euclidean system '0: x-axis', '1: y-axis', ...)
-
getMax
public final double getMax()
- Specified by:
getMaxin interfaceAxisDescription- Overrides:
getMaxin classDataRange- Returns:
- Returns the max.
-
getMin
public final double getMin()
- Specified by:
getMinin interfaceAxisDescription- Overrides:
getMinin classDataRange- Returns:
- the minimum of the range
-
getName
public final java.lang.String getName()
- Specified by:
getNamein interfaceAxisDescription- Returns:
- axis name
-
getUnit
public final java.lang.String getUnit()
- Specified by:
getUnitin interfaceAxisDescription- Returns:
- the unit of the axis, typically in SI units such as 's', 'V' etc. or 'a.u.'
-
set
public boolean set(DataRange range)
Description copied from class:DataRangeSets updates range to the specified one.
-
set
public boolean set(double min, double max)Description copied from class:DataRangeSetsminandmaxvalues for this range.- Specified by:
setin interfaceAxisDescription- Overrides:
setin classDataRange- Parameters:
min- new minimum of the rangemax- new maximum of the range- Returns:
trueif the values becomes the newminormax.
-
set
public final boolean set(java.lang.String axisName, java.lang.String... axisUnit)- Specified by:
setin interfaceAxisDescription- Parameters:
axisName- the new axis nameaxisUnit- the new axis unit (optional variadic argument) N.B. issues- Returns:
trueif this setter invalidates the existing min/max range- See Also:
event if only the name/unit changed, or,event if only the range changed, or,for a full change
-
set
public final boolean set(java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)- Specified by:
setin interfaceAxisDescription- Parameters:
axisName- the new axis nameaxisUnit- the new axis unitrangeMin- the user-provided new minimum value of the DataSet/Axis rangerangeMax- the user-provided new maximum value of the DataSet/Axis range- Returns:
trueif this setter invalidates the existing min/max range- See Also:
event if only the name/unit changed, or,event if only the range changed, or,for a full change
-
setMax
public boolean setMax(double max)
Description copied from class:DataRangeSetsmaxvalue for this range.- Specified by:
setMaxin interfaceAxisDescription- Overrides:
setMaxin classDataRange- Parameters:
max- the new max value- Returns:
trueif the value becomes the newmax.
-
setMin
public boolean setMin(double min)
Description copied from class:DataRangeSetsminvalue for this range.- Specified by:
setMinin interfaceAxisDescription- Overrides:
setMinin classDataRange- Parameters:
min- the new data range minimum- Returns:
trueif the value becomes the newmin.
-
updateEventListener
public java.util.List<EventListener> updateEventListener()
- Specified by:
updateEventListenerin interfaceEventSource- Returns:
- list containing all update event listener (needs to be provided by implementing class)
-
-