Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
generated.docs.javadoc.org.eclipse.dawnsci.nexus.impl.NXobjectImpl.html Maven / Gradle / Ivy
NXobjectImpl (h5jan API)
JavaScript is disabled on your browser.
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<NodeLink >, GroupNode , Node , NXobject
Direct Known Subclasses:
NXapertureImpl , NXattenuatorImpl , NXbeam_stopImpl , NXbeamImpl , NXbending_magnetImpl , NXcapillaryImpl , NXciteImpl , NXcollectionImpl , NXcollimatorImpl , NXcontainerImpl , NXcrystalImpl , NXcylindrical_geometryImpl , NXdataImpl , NXdetector_groupImpl , NXdetector_moduleImpl , NXdetectorImpl , NXdisk_chopperImpl , NXelectrostatic_kickerImpl , NXentryImpl , NXenvironmentImpl , NXevent_dataImpl , NXfermi_chopperImpl , NXfilterImpl , NXflipperImpl , NXfresnel_zone_plateImpl , NXgeometryImpl , NXgratingImpl , NXguideImpl , NXinsertion_deviceImpl , NXinstrumentImpl , NXlogImpl , NXmagnetic_kickerImpl , NXmirrorImpl , NXmoderatorImpl , NXmonitorImpl , NXmonochromatorImpl , NXnoteImpl , NXoff_geometryImpl , NXorientationImpl , NXparametersImpl , NXpinholeImpl , NXpolarizerImpl , NXpositionerImpl , NXprocessImpl , NXquadrupole_magnetImpl , NXreflectionsImpl , NXrootImpl , NXsample_componentImpl , NXsampleImpl , NXsensorImpl , NXseparatorImpl , NXshapeImpl , NXslitImpl , NXsolenoid_magnetImpl , NXsourceImpl , NXspin_rotatorImpl , NXsubentryImpl , NXtransformationsImpl , NXtranslationImpl , NXuserImpl , NXvelocity_selectorImpl , NXxraylensImpl
public abstract class NXobjectImpl
extends GroupNodeImpl
implements NXobject
The abstract superclass of all base class implementation classes.
Unlike the base class implementation classes, this class is
not autogenerated.
See Also:
Serialized Form
Field Summary
Fields
Modifier and Type
Field and Description
static java.lang.String
NX_CLASS
Name of attribute
protected static long
serialVersionUID
Constructor Summary
Constructors
Modifier
Constructor and Description
protected
NXobjectImpl ()
Creates a new NeXus group node.
protected
NXobjectImpl (long oid)
Creates a new NeXus group node.
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
void
addExternalLink (java.lang.String name,
java.lang.String externalFileName,
java.lang.String pathToNode)
Adds an external link within the given name within this node to the node
with the given path within the file with the given name.
protected void
appendNodeString (java.lang.StringBuilder s,
java.lang.String n)
boolean
canAddChild (NXobject nexusObject)
Returns whether the given NeXus group object can be added as a child group
to this base class instance according to the NXDL definition for this base class.
DataNode
createDataNode (java.lang.String name,
ILazyDataset value)
Creates and adds a new datanode to this group for the given field name and
with the given dataset as its value.
java.util.Map<java.lang.String,IDataset>
getAllDatasets ()
Returns all datasets as a map keyed by field name
Dataset
getAttr (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute.
java.lang.Boolean
getAttrBoolean (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute as a Boolean
, or null
if not set.
java.util.Date
getAttrDate (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute as a date.
java.lang.Double
getAttrDouble (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute as a Double
, or null
if not set.
java.lang.Long
getAttrLong (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute as a Long
, or null
if not set.
java.lang.Number
getAttrNumber (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute as a number.
java.lang.String
getAttrString (java.lang.String name,
java.lang.String attrName)
Get the value of the given attribute as a String
.
java.lang.Boolean
getBoolean (java.lang.String name)
Gets the value of the given field as a boolean, or null
if not set
<N extends NXobject > N
getChild (java.lang.String name,
java.lang.Class<N> nxClass)
Returns the child of this node of the given type with the given name.
java.util.Map<java.lang.String,NXobject >
getChildren ()
Returns a map containing all the children of this node.
<N extends NXobject > java.util.Map<java.lang.String,N>
getChildren (java.lang.Class<N> nxClass)
Returns a map containing all the children of this node of the given class.
IDataset
getDataset (java.lang.String name)
Gets the dataset for the field with the given name, if it exists, otherwise null
.
java.util.Date
getDate (java.lang.String name)
Gets the value of the given field as a date.
java.lang.Double
getDouble (java.lang.String name)
Gets the value of the given field as a Double
, or null
if not set.
ILazyWriteableDataset
getLazyWritableDataset (java.lang.String name)
Returns the ILazyWriteableDataset
for the field within this object with the given name,
or null
if no such field exists, or the dataset for this field is not a
ILazyWriteableDataset
java.lang.Long
getLong (java.lang.String name)
Gets the value of the given field as a long, or null
if not set.
java.lang.Number
getNumber (java.lang.String name)
Gets the value of the given field as a number, or null
if not set.
java.lang.String
getString (java.lang.String name)
Gets the value of the given field as a string.
ILazyWriteableDataset
initializeFixedSizeLazyDataset (java.lang.String name,
int[] shape,
java.lang.Class<?> dtype)
Creates and adds a new ILazyWriteableDataset
to this group for the given field
name with the given fixed shape and of the given element class
ILazyWriteableDataset
initializeLazyDataset (java.lang.String name,
int[] maxShape,
java.lang.Class<?> dtype)
Creates and adds a new ILazyWriteableDataset
to this group for the given field name,
with the given maximum shape and of the given element class
ILazyWriteableDataset
initializeLazyDataset (java.lang.String name,
int rank,
java.lang.Class<?> dtype)
Creates and adds a new ILazyWriteableDataset
to this group for the given field name,
with the given rank (dimensionality) and of the given element class
<N extends NXobject > void
putChild (java.lang.String name,
N child)
Add a child node with the given name.
void
setAttribute (java.lang.String name,
java.lang.String attrName,
java.lang.Object attrValue)
Set the value of the given attribute.
<N extends NXobject > void
setChildren (java.util.Map<java.lang.String,N> map)
Adds the child nodes with the given names.
DataNode
setDataset (java.lang.String name,
IDataset value)
Sets the dataset for the field with the given name
protected DataNode
setDate (java.lang.String name,
java.util.Date date)
DataNode
setField (java.lang.String name,
java.lang.Object value)
Set the value of the given field to the given value.
DataNode
setString (java.lang.String name,
java.lang.String value)
Methods inherited from class org.eclipse.dawnsci.analysis.tree.impl.GroupNodeImpl
addDataNode , addGroupNode , addNode , addNodeLink , addSymbolicNode , containsDataNode , containsGroupNode , containsNode , containsSymbolicNode , createNodeLink , findLinkedNodeName , findNodeLink , getDataNode , getDataNodeMap , getDataNodes , getDatasets , getGlobalPool , getGroupNode , getGroupNodeMap , getGroupNodes , getNames , getNode , getNodeLink , getNodeNameIterator , getNumberOfDataNodes , getNumberOfGroupNodes , getNumberOfNodelinks , getSymbolicNode , isGroupNode , isPopulated , iterator , removeDataNode , removeDataNode , removeGroupNode , removeGroupNode , removeSymbolicNode , removeSymbolicNode , setGlobalPool , toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.dawnsci.analysis.api.tree.GroupNode
addDataNode , addGroupNode , addNode , addNodeLink , addSymbolicNode , containsDataNode , containsGroupNode , containsNode , containsSymbolicNode , findLinkedNodeName , findNodeLink , getDataNode , getDataNodeMap , getDataNodes , getDatasets , getGlobalPool , getGroupNode , getGroupNodeMap , getGroupNodes , getNames , getNode , getNodeLink , getNodeNameIterator , getNumberOfDataNodes , getNumberOfGroupNodes , getNumberOfNodelinks , getSymbolicNode , isPopulated , iterator , removeDataNode , removeDataNode , removeGroupNode , removeGroupNode , removeSymbolicNode , removeSymbolicNode , setGlobalPool
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Method Detail
canAddChild
public boolean canAddChild(NXobject nexusObject)
Description copied from interface: NXobject
Returns whether the given NeXus group object can be added as a child group
to this base class instance according to the NXDL definition for this base class.
Specified by:
canAddChild
in interface NXobject
Parameters:
nexusObject
- potential child nexus group object
Returns:
true
if the given group object can be added as a child of this base
class instance, false
otherwise
getChild
public <N extends NXobject > N getChild(java.lang.String name,
java.lang.Class<N> nxClass)
Description copied from interface: NXobject
Returns the child of this node of the given type with the given name.
Specified by:
getChild
in interface NXobject
Parameters:
name
- of child
nxClass
- class of child
Returns:
named child NXobject of given NeXus class or null
if none
getDataset
public IDataset getDataset(java.lang.String name)
Description copied from interface: NXobject
Gets the dataset for the field with the given name, if it exists, otherwise null
.
Note that this method should only be used for small datasets, i.e. those set before the scan.
To get the dataset for larger datasets (i.e. data acquired during the scan) use
getDataNode(name).getDataset()
which returns an ILazyDataset
.
Specified by:
getDataset
in interface NXobject
Parameters:
name
- dataset name
Returns:
the dataset for the field with the given name, or null
if the no such dataset exists
getLazyWritableDataset
public ILazyWriteableDataset getLazyWritableDataset(java.lang.String name)
Description copied from interface: NXobject
Returns the ILazyWriteableDataset
for the field within this object with the given name,
or null
if no such field exists, or the dataset for this field is not a
ILazyWriteableDataset
Specified by:
getLazyWritableDataset
in interface NXobject
Parameters:
name
- field name
Returns:
the ILazyWriteableDataset
for the given field if it exists, otherwise null
setDataset
public DataNode setDataset(java.lang.String name,
IDataset value)
Description copied from interface: NXobject
Sets the dataset for the field with the given name
Specified by:
setDataset
in interface NXobject
Returns:
the new data node, for convenience
initializeLazyDataset
public ILazyWriteableDataset initializeLazyDataset(java.lang.String name,
int rank,
java.lang.Class<?> dtype)
Description copied from interface: NXobject
Creates and adds a new ILazyWriteableDataset
to this group for the given field name,
with the given rank (dimensionality) and of the given element class
Specified by:
initializeLazyDataset
in interface NXobject
Parameters:
name
- field name
rank
- rank
dtype
- dataset element class
Returns:
new lazy writable dataset
initializeLazyDataset
public ILazyWriteableDataset initializeLazyDataset(java.lang.String name,
int[] maxShape,
java.lang.Class<?> dtype)
Description copied from interface: NXobject
Creates and adds a new ILazyWriteableDataset
to this group for the given field name,
with the given maximum shape and of the given element class
Specified by:
initializeLazyDataset
in interface NXobject
Parameters:
name
- field name
maxShape
- the maximum shape
dtype
- dataset element class
Returns:
new lazy writable dataset
initializeFixedSizeLazyDataset
public ILazyWriteableDataset initializeFixedSizeLazyDataset(java.lang.String name,
int[] shape,
java.lang.Class<?> dtype)
Description copied from interface: NXobject
Creates and adds a new ILazyWriteableDataset
to this group for the given field
name with the given fixed shape and of the given element class
Specified by:
initializeFixedSizeLazyDataset
in interface NXobject
Parameters:
name
- field name
dtype
- dataset element class
Returns:
new lazy writable dataset
addExternalLink
public void addExternalLink(java.lang.String name,
java.lang.String externalFileName,
java.lang.String pathToNode)
Description copied from interface: NXobject
Adds an external link within the given name within this node to the node
with the given path within the file with the given name.
The external file need not exist at the time this method is invoked.
Specified by:
addExternalLink
in interface NXobject
Parameters:
name
- name of link within this group
externalFileName
- name of external file to link to
pathToNode
- path of node within external file to link to
createDataNode
public DataNode createDataNode(java.lang.String name,
ILazyDataset value)
Description copied from interface: NXobject
Creates and adds a new datanode to this group for the given field name and
with the given dataset as its value. The given dataset may be either a
ILazyWriteableDataset
or an IDataset
.
Specified by:
createDataNode
in interface NXobject
Parameters:
name
- field name
value
- dataset
Returns:
new data node
getChildren
public <N extends NXobject > java.util.Map<java.lang.String,N> getChildren(java.lang.Class<N> nxClass)
Description copied from interface: NXobject
Returns a map containing all the children of this node of the given class. The keys of the
map are the names of the child nodes.
Specified by:
getChildren
in interface NXobject
Parameters:
nxClass
- class of children.
Returns:
map of children, key is child node's name
putChild
public <N extends NXobject > void putChild(java.lang.String name,
N child)
Description copied from interface: NXobject
Add a child node with the given name. This method should be used with caution
as it allows a child group to be added that may not be permitted by the NXDL
base class definition for this base class. In preference, the relevant
set method on the base class specific sub-interface of this interface
should be used.
Specified by:
putChild
in interface NXobject
Parameters:
name
- name of child group
child
- child group
setChildren
public <N extends NXobject > void setChildren(java.util.Map<java.lang.String,N> map)
Description copied from interface: NXobject
Adds the child nodes with the given names.
This method should be used with caution as it allows a child group
to be added that may not be permitted by the NXDL
base class definition for this base class. In preference, the relevant
set method on the base class specific sub-interface of this interface
should be used.
Specified by:
setChildren
in interface NXobject
Parameters:
map
- map from names to child nodes to add
getAllDatasets
public java.util.Map<java.lang.String,IDataset> getAllDatasets()
Description copied from interface: NXobject
Returns all datasets as a map keyed by field name
Specified by:
getAllDatasets
in interface NXobject
Returns:
all datasets
getBoolean
public java.lang.Boolean getBoolean(java.lang.String name)
Description copied from interface: NXobject
Gets the value of the given field as a boolean, or null
if not set
Specified by:
getBoolean
in interface NXobject
Parameters:
name
- name of field
Returns:
the value of the given field as a boolean, null
if
there is no field with the given name
getLong
public java.lang.Long getLong(java.lang.String name)
Description copied from interface: NXobject
Gets the value of the given field as a long, or null
if not set.
Specified by:
getLong
in interface NXobject
Parameters:
name
- name of field
Returns:
the value of the given field as a long, null
if
there is no field with the given name
getDouble
public java.lang.Double getDouble(java.lang.String name)
Description copied from interface: NXobject
Gets the value of the given field as a Double
, or null
if not set.
Specified by:
getDouble
in interface NXobject
Parameters:
name
- name of field
Returns:
the value of the given field as a double, null
if
there is no field with the given name
getNumber
public java.lang.Number getNumber(java.lang.String name)
Description copied from interface: NXobject
Gets the value of the given field as a number, or null
if not set.
Specified by:
getNumber
in interface NXobject
Parameters:
name
- name of field
Returns:
the value of the given field as a number, null
if
there is no field with the given name
setField
public DataNode setField(java.lang.String name,
java.lang.Object value)
Set the value of the given field to the given value. The
value may be an atomic value (e.g. primitive wrapper, object or string),
or a dataset.
Specified by:
setField
in interface NXobject
Parameters:
name
- name
value
- value
Returns:
the newly created DataNode
.
setAttribute
public void setAttribute(java.lang.String name,
java.lang.String attrName,
java.lang.Object attrValue)
Description copied from interface: NXobject
Set the value of the given attribute. If the first argument is not null
then the attribute is set on the field or child group with this name
Specified by:
setAttribute
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
attrValue
- attribute value
getAttr
public Dataset getAttr(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute. If the first argument is
not null
then returns the value of attribute of the field
or child group with that name.
Specified by:
getAttr
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a long
getAttrString
public java.lang.String getAttrString(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute as a String
. If the first argument is
not null
then returns the value of attribute of the field
or child group with that name.
Specified by:
getAttrString
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a long
getAttrBoolean
public java.lang.Boolean getAttrBoolean(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute as a Boolean
, or null
if not set.
If the first argument is not null
then returns the value of attribute of the
field or child group with that name.
Specified by:
getAttrBoolean
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a Boolean
, or null
if not set
getAttrLong
public java.lang.Long getAttrLong(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute as a Long
, or null
if not set.
If the first argument is not null
then returns the value of attribute of the
field or child group with that name.
Specified by:
getAttrLong
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a Long, or null
if not set
getAttrDouble
public java.lang.Double getAttrDouble(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute as a Double
, or null
if not set.
If the first argument is not null
then returns the value of attribute of the
field or child group with that name.
Specified by:
getAttrDouble
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a double
getAttrNumber
public java.lang.Number getAttrNumber(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute as a number. If the first argument is
not null
then returns the value of attribute of the field
or child group with that name.
Specified by:
getAttrNumber
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a number
getAttrDate
public java.util.Date getAttrDate(java.lang.String name,
java.lang.String attrName)
Description copied from interface: NXobject
Get the value of the given attribute as a date. If the first argument is
not null
then returns the value of attribute of the field
or child group with that name.
Specified by:
getAttrDate
in interface NXobject
Parameters:
name
- name of node (if null
then current group)
attrName
- attribute name
Returns:
value of attribute as a date, or null
if
no such attribute or value cannot be parsed as a date