Package de.gsi.dataset.spi
Class DefaultAxisDescription
- java.lang.Object
-
- de.gsi.dataset.spi.DataRange
-
- de.gsi.dataset.spi.DefaultAxisDescription
-
- All Implemented Interfaces:
AxisDescription
public class DefaultAxisDescription extends DataRange implements AxisDescription
Simple default implementation of the AxisDescription interface- Author:
- rstein
-
-
Constructor Summary
Constructors Constructor Description DefaultAxisDescription()DefaultDefaultAxisDescription(DataSet dataSet, AxisDescription axisDesc)Copy constructor to generate axisDescriptions for datasets from existing Axis DescriptionsDefaultAxisDescription(DataSet dataSet, java.lang.String axisName, java.lang.String... axisUnit)DefaultAxisDescription(DataSet dataSet, java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)DefaultAxisDescription(java.lang.String axisName, java.lang.String... axisUnit)
-
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 nlength)Adds values to this range.booleanclear()Empties this DataRange.booleanequals(java.lang.Object obj)booleanequals(java.lang.Object obj, double epsilon)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()-
Methods inherited from class de.gsi.dataset.spi.DataRange
add, add, contains, getLength, isDefined, isMaxDefined, isMinDefined
-
-
-
-
Constructor Detail
-
DefaultAxisDescription
public DefaultAxisDescription()
Default
-
DefaultAxisDescription
public DefaultAxisDescription(DataSet dataSet, AxisDescription axisDesc)
Copy constructor to generate axisDescriptions for datasets from existing Axis Descriptions- Parameters:
dataSet- for which the update events shall be registeredaxisDesc- axis Description to copy all data except dataSet from
-
DefaultAxisDescription
public DefaultAxisDescription(DataSet dataSet, java.lang.String axisName, java.lang.String... axisUnit)
- Parameters:
dataSet- for which the update events shall be registeredaxisName- the new axis nameaxisUnit- the new axis unit
-
DefaultAxisDescription
public DefaultAxisDescription(DataSet dataSet, java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)
- Parameters:
dataSet- for which the update events shall be registeredaxisName- 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
-
DefaultAxisDescription
public DefaultAxisDescription(java.lang.String axisName, java.lang.String... axisUnit)- Parameters:
axisName- the new axis nameaxisUnit- the new axis unit
-
-
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 nlength)Adds values to this range.- Specified by:
addin interfaceAxisDescription- Overrides:
addin classDataRange- Parameters:
values- values to be addednlength- the maximum array length that should be taken into account- Returns:
trueif the value becomesminormax.
-
clear
public boolean clear()
Empties this DataRange. After calling this method this data range becomes undefined.- Specified by:
clearin interfaceAxisDescription- Overrides:
clearin classDataRange- Returns:
trueif the values were valid before- See Also:
DataRange.isDefined()
-
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
-
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.
-
-