Package de.gsi.dataset
Interface AxisDescription
-
- All Superinterfaces:
EventSource,java.io.Serializable
- All Known Implementing Classes:
DefaultAxisDescription
public interface AxisDescription extends EventSource, java.io.Serializable
Axis description containing the axis name, its unit as well as its minimum and maximum range.N.B. this description is given per dimension (ie. one for "X" and one for "Y" for a typical X-Y dataset/plot)
example usages: [..].setName("x-axis"); // for setting only the name [..].setName("time", "s"); // for setting the axis name and unit [..].setName("voltage", "V", 0.0, 230.0); // for setting the axis name, unit and explicit min/max values [..].setName("intensity", "ppp", 1e9, 1e10, 1e8, 1e11); // or [..].setName("intensity", "ppp", intensityRange); // for an unsorted range list based on which the internal min/max range is updated.
- Author:
- akrimm, rstein
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanadd(double value)Adds value to this range.default booleanadd(double[] values)Adds values to this range.booleanadd(double[] values, int length)Adds values to this range.booleanclear()Empties this DataRange.booleancontains(double value)intgetDimIndex()doublegetLength()doublegetMax()doublegetMin()java.lang.StringgetName()java.lang.StringgetUnit()booleanisDefined()Determines if axis range is defined - ie.booleanset(double min, double max)Setsminandmaxvalues for this range.default booleanset(AxisDescription range)Sets updates this AxisDescription with the specified other 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.-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
-
-
-
Method Detail
-
add
boolean add(double value)
Adds value to this range.- Parameters:
value- value to be added- Returns:
trueif the value becomesminormax.
-
add
default boolean add(double[] values)
Adds values to this range.- Parameters:
values- values to be added- Returns:
trueif the value becomesminormax.
-
add
boolean add(double[] values, int length)Adds values to this range.- Parameters:
values- values to be addedlength- the maximum array length that should be taken into account- Returns:
trueif the value becomesminormax.
-
clear
boolean clear()
Empties this DataRange. After calling this method this data range becomes undefined.- Returns:
trueif the values were valid before- See Also:
isDefined()
-
contains
boolean contains(double value)
-
getDimIndex
int getDimIndex()
- Returns:
- numeric dimension index this AxisDescription refers to (e.g. for a euclidean system '0: x-axis', '1: y-axis', ...)
-
getLength
double getLength()
-
getMax
double getMax()
- Returns:
- maximum value of the axis or DataSet
-
getMin
double getMin()
- Returns:
- minimum value of the axis or DataSet
-
getName
java.lang.String getName()
- Returns:
- axis name
-
getUnit
java.lang.String getUnit()
- Returns:
- the unit of the axis, typically in SI units such as 's', 'V' etc. or 'a.u.'
-
isDefined
boolean isDefined()
Determines if axis range is defined - ie. ifminandmaxvalues are defined.- Returns:
trueif range is well defined
-
set
default boolean set(AxisDescription range)
Sets updates this AxisDescription with the specified other one.- Parameters:
range- otherAxisDescriptionobject- Returns:
trueif the value becomesminormax.
-
set
boolean set(double min, double max)Setsminandmaxvalues for this range.- Parameters:
min- new minimum of the rangemax- new maximum of the range- Returns:
trueif the values becomes the newminormax.
-
set
boolean set(java.lang.String axisName, java.lang.String... axisUnit)- 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
boolean set(java.lang.String axisName, java.lang.String axisUnit, double rangeMin, double rangeMax)- 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
boolean setMax(double max)
Setsmaxvalue for this range.- Parameters:
max- the new max value- Returns:
trueif the value becomes the newmax.
-
setMin
boolean setMin(double min)
Setsminvalue for this range.- Parameters:
min- the new max value- Returns:
trueif the value becomes the newmin.
-
-