@Platform(include="<nix/Dimensions.hpp>") @Platform(value="linux",link="nix@.1",preload="hdf5@.7") @Platform(value="windows",link="nix",preload={"hdf5","msvcp120","msvcr120","szip","zlib"}) @Namespace(value="nix") public class RangeDimension<T extends RangeDimension> extends ImplContainer implements Comparable<T>
The RangeDimension covers cases when indexes of a dimension are mapped to other values
in a not regular fashion. A use-case for this would be for example irregularly sampled
time-series or certain kinds of histograms. To achieve the mapping of the indexes an
array of mapping values must be provided. Those values are stored in the dimensions setTicks(double[])
property. In analogy to the sampled dimension a setUnit(String)
and a setLabel(String)
can be defined.
Dimension
,
SampledDimension
,
SetDimension
Constructor and Description |
---|
RangeDimension()
Constructor that creates an uninitialized RangeDimension.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(T dimension) |
double[] |
getAxis(long count)
Returns a list containing a number of ticks.
|
double[] |
getAxis(long count,
long startIndex)
Returns a list containing a number of ticks.
|
int |
getDimensionType()
The type of the dimension.
|
long |
getIndex()
The actual dimension that is described by the dimension descriptor.
|
long |
getIndexOf(double position)
Returns the index of the given position.
|
String |
getLabel()
Getter for the label of the dimension.
|
double |
getTickAt(long index)
Returns the entry of the range dimension at a given index.
|
double[] |
getTicks()
Get the ticks of the dimension.
|
String |
getUnit()
Gets the unit of a dimension.
|
boolean |
isAlias()
Tells if the RangeDimension uses the contents of a linked DataArray for ticks,
i.e. is an alias.
|
boolean |
isNone()
Check if entity is null
|
void |
setLabel(String label)
Sets the label of the dimension.
|
void |
setTicks(double[] ticks)
Set the ticks array for the dimension.
|
void |
setUnit(String unit)
Sets the unit of a dimension.
|
isInitialized
address, asBuffer, asByteBuffer, capacity, capacity, deallocate, deallocate, deallocateReferences, equals, fill, hashCode, isNull, limit, limit, memchr, memcmp, memcpy, memmove, memset, offsetof, position, position, put, setNull, sizeof, toString, zero
public RangeDimension()
Calling any method on an uninitialized dimension will throw a RuntimeException
.
@Cast(value="bool") public boolean isNone()
ImplContainer
isNone
in class ImplContainer
@Name(value="alias") public boolean isAlias()
@Name(value="index") @Cast(value="size_t") public long getIndex()
The index of the dimension entity representing the dimension of the actual data that is defined by this descriptor.
@Name(value="dimensionType") @ByVal @Cast(value="nix::DimensionType") public int getDimensionType()
This field indicates whether the dimension is a SampledDimension, SetDimension or RangeDimension.
public String getLabel()
The label of a RangeDimension corresponds to the axis label in a plot of the respective dimension.
public void setLabel(String label)
label
- The label of the dimension.public String getUnit()
The unit describes which SI unit applies to this dimension and to its sampling interval.
public void setUnit(String unit)
unit
- The unit to set.public double[] getTicks()
The ticks map the index of the data at the respective dimension to other values. This can be used to store data that is sampled at irregular intervals.
@Name(value="ticks") public void setTicks(@StdVector double[] ticks)
Ticks must be ordered in ascending order.
ticks
- The new ticks for the dimension provided as an array.@Name(value="tickAt") public double getTickAt(@Cast(value="const size_t") long index)
index
- The index.@Name(value="indexOf") @Cast(value="size_t") public long getIndexOf(double position)
Method will return the index equal or larger than position
position
- The position.public double[] getAxis(long count, long startIndex)
The result list contains a given number of ticks starting from a starting index
count
- The number of ticks.startIndex
- The starting index.public double[] getAxis(long count)
The result list contains a given number of ticks starting from a starting index
count
- The number of ticks.public int compareTo(T dimension)
compareTo
in interface Comparable<T extends RangeDimension>
Copyright © 2016. All rights reserved.