generated.docs.javadoc.org.eclipse.dawnsci.nexus.builder.data.impl.DefaultNexusDataBuilder.html Maven / Gradle / Ivy
DefaultNexusDataBuilder (h5jan API)
org.eclipse.dawnsci.nexus.builder.data.impl
Class DefaultNexusDataBuilder
- java.lang.Object
-
- org.eclipse.dawnsci.nexus.builder.data.impl.AbstractNexusDataBuilder
-
- org.eclipse.dawnsci.nexus.builder.data.impl.DefaultNexusDataBuilder
-
- All Implemented Interfaces:
- NexusDataBuilder
public class DefaultNexusDataBuilder
extends AbstractNexusDataBuilder
implements NexusDataBuilder
Default implementation of NexusDataBuilder
.
-
-
Field Summary
-
Fields inherited from class org.eclipse.dawnsci.nexus.builder.data.impl.AbstractNexusDataBuilder
entryBuilder, nxData
-
Fields inherited from interface org.eclipse.dawnsci.nexus.builder.data.NexusDataBuilder
ATTR_NAME_AXES, ATTR_NAME_LONG_NAME, ATTR_NAME_SIGNAL, ATTR_NAME_TARGET, ATTR_SUFFIX_INDICES, NO_DEFAULT_AXIS_PLACEHOLDER
-
Constructor Summary
Constructors
Constructor and Description
DefaultNexusDataBuilder(NexusEntryBuilder entryBuilder,
NXdata nxData)
Create a new DefaultNexusDataBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
<N extends NXobject>
void
addAxisDevice(AxisDataDevice<N> axisDataDevice)
Adds the data fields of the given device to the wrapped NXdata
group.
<N extends NXobject>
void
addAxisDevice(NexusObjectProvider<N> dataDevice,
java.lang.Integer defaultAxisDimension,
int... dimensionMappings)
Adds the data fields of the given device to the wrapped NXdata
group.
NXdata
getNxData()
Returns the wrapped NXdata
object.
<N extends NXobject>
void
setPrimaryDevice(PrimaryDataDevice<N> primaryDataDevice)
Sets the given device as the primary device of the wrapped NXdata
group.
-
Methods inherited from class org.eclipse.dawnsci.nexus.builder.data.impl.AbstractNexusDataBuilder
addAxisDevice, setPrimaryDevice
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.dawnsci.nexus.builder.data.NexusDataBuilder
addAxisDevice, setPrimaryDevice
-
-
Constructor Detail
-
DefaultNexusDataBuilder
public DefaultNexusDataBuilder(NexusEntryBuilder entryBuilder,
NXdata nxData)
Create a new DefaultNexusDataBuilder
. This constructor should only be
called by DefaultNexusEntryBuilder
.
- Parameters:
entryBuilder
- parent entry builder
nxData
- NXdata
object to wrap
-
Method Detail
-
getNxData
public NXdata getNxData()
Description copied from interface: NexusDataBuilder
Returns the wrapped NXdata
object. This can be used if client
code needs to modify the NXdata
group in a custom way.
- Specified by:
getNxData
in interface NexusDataBuilder
- Overrides:
getNxData
in class AbstractNexusDataBuilder
- Returns:
- the
NXdata
-
setPrimaryDevice
public <N extends NXobject> void setPrimaryDevice(PrimaryDataDevice<N> primaryDataDevice)
throws NexusException
Description copied from interface: NexusDataBuilder
Sets the given device as the primary device of the wrapped NXdata
group. The given DataDevice
object wraps a
NexusObjectProvider
and provides methods for configuring how the
DataNode
s for the device should be added to the NXdata
group.
- Specified by:
setPrimaryDevice
in interface NexusDataBuilder
- Parameters:
primaryDataDevice
- a DataDevice
wrapping the NexusObjectProvider
that provides the NXobject
whose fields should be
added to the NXdata
- Throws:
NexusException
- if the device could not be added for any reason
-
addAxisDevice
public <N extends NXobject> void addAxisDevice(NexusObjectProvider<N> dataDevice,
java.lang.Integer defaultAxisDimension,
int... dimensionMappings)
throws NexusException
Description copied from interface: NexusDataBuilder
Adds the data fields of the given device to the wrapped NXdata
group. The fields do add are determined by
NexusObjectProvider.getAxisDataFieldNames()
.
Additionally the field with the name as returned by
NexusObjectProvider.getDefaultAxisDataFieldName()
, or by
NexusObjectProvider.getPrimaryDataFieldName()
if the
former is null
is set as the default axis of the main data
field of the NXdata
for the dimension with the given index (e.g.
the value of the @axes
attribute at that index is set to the
name of this field).
The dimension mappings for each field are set to those given. The
possible exception is that if the field that default axis dimension
applies to has a rank of 1 then this single dimension will be mapped to
the dimension of the given index of the main dataset.
- Specified by:
addAxisDevice
in interface NexusDataBuilder
- Parameters:
dataDevice
- data device
defaultAxisDimension
- the index of the axis of the main data field of the wrapped
NXdata
for which this device provides a default axis
value
dimensionMappings
- dimension mappings between the data field(s) of the device
and the @signal
field of the NXdata
group
- Throws:
NexusException
- if the device could not be added for any reason
-
addAxisDevice
public <N extends NXobject> void addAxisDevice(AxisDataDevice<N> axisDataDevice)
throws NexusException
Description copied from interface: NexusDataBuilder
Adds the data fields of the given device to the wrapped NXdata
group. The given DataDevice
object wraps a
NexusObjectProvider
and provides methods for configuring how the
DataNode
s for the device should be added to the NXdata
- Specified by:
addAxisDevice
in interface NexusDataBuilder
- Parameters:
axisDataDevice
- a DataDevice
wrapping the NexusObjectProvider
that provides the NXobject
whose fields should be
added to the NXdata
- Throws:
NexusException
- if the device could not be added for any reason