public class EvioNode
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
org.jlab.coda.jevio.BlockNode |
blockNode
Block containing this node.
|
Constructor and Description |
---|
EvioNode()
Constructor when fancy features not needed.
|
EvioNode(int pos,
int place,
BufferNode bufferNode,
org.jlab.coda.jevio.BlockNode blockNode)
Constructor which creates an EvioNode associated with
an event (top level) evio container when parsing buffers
for evio data.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all data in this object.
|
void |
clearAll() |
void |
clearIntArray() |
void |
clearLists()
Clear the childNode it is exists.
|
void |
clearObjects()
Empty all lists and remove all other objects from this object.
|
java.lang.Object |
clone() |
void |
getAllDescendants(java.util.List<EvioNode> descendants)
Get the list of all descendant nodes that this node contains -
not only the immediate children.
|
java.util.ArrayList<EvioNode> |
getAllNodes()
Get the list of all nodes that this node contains,
always including itself.
|
BufferNode |
getBufferNode()
Get the object containing the buffer that this node is associated with.
|
java.nio.ByteBuffer |
getByteData(boolean copy)
Get the data associated with this node in ByteBuffer form.
|
EvioNode |
getChildAt(int index)
Get the child node at the given index (starts at 0).
|
int |
getChildCount()
Get the number all children that this node contains.
|
java.util.ArrayList<EvioNode> |
getChildNodes()
Get the list of all child nodes that this node contains.
|
int |
getDataLength()
Get the length of this evio structure's data only (no header words)
in 32-bit words.
|
int |
getDataPosition()
Get the file/buffer byte position of this evio structure's data.
|
int |
getDataType()
Get the evio type of the data this evio structure contains.
|
DataType |
getDataTypeObj()
Get the evio type of the data this evio structure contains as an object.
|
int |
getEventNumber()
If this object represents an event (top-level, evio bank),
then returns its number (place in file or buffer) starting
with 1.
|
int[] |
getIntData()
Get the data associated with this node as an 32-bit integer array.
|
int[] |
getIntData(int[] intData,
int[] length)
Get the data associated with this node as an 32-bit integer array.
|
int |
getLength()
Get the length of this evio structure (not including length word itself)
in 32-bit words.
|
long[] |
getLongData()
Get the data associated with this node as an 64-bit integer array.
|
long[] |
getLongData(long[] longData,
int[] length)
Get the data associated with this node as an 64-bit integer array.
|
int |
getNum()
Get the num of this evio structure.
|
int |
getPad()
Get the padding of this evio structure.
|
int |
getPosition()
Get the file/buffer byte position of this evio structure.
|
short[] |
getShortData()
Get the data associated with this node as an 16-bit integer array.
|
short[] |
getShortData(short[] shortData,
int[] length)
Get the data associated with this node as an 16-bit integer array.
|
java.nio.ByteBuffer |
getStructureBuffer(boolean copy)
Get this node's entire evio structure in ByteBuffer form.
|
int |
getTag()
Get the tag of this evio structure.
|
int |
getTotalBytes()
Get the length of this evio structure including entire header in bytes.
|
int |
getType()
Get the evio type of this evio structure, not what it contains.
|
DataType |
getTypeObj()
Get the evio type of this evio structure as an object.
|
boolean |
isEvent()
Does this object represent an event?
|
boolean |
isObsolete()
Has the data this node represents in the buffer been removed?
|
java.lang.String |
toString() |
void |
updateNum(int newNum)
Update, in the buffer, the num of the bank header this object represents.
|
void |
updateTag(int newTag)
Update, in the buffer, the tag of the structure header this object represents.
|
public EvioNode()
public EvioNode(int pos, int place, BufferNode bufferNode, org.jlab.coda.jevio.BlockNode blockNode)
pos
- position of event in buffer (number of bytes)place
- containing event's place in buffer (starting at 1)bufferNode
- buffer containing this eventblockNode
- block containing this eventpublic final java.lang.Object clone()
clone
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
public final void clearLists()
public final void clear()
public final void clearObjects()
public final void clearAll()
public final void clearIntArray()
public final boolean isObsolete()
public final java.util.ArrayList<EvioNode> getAllNodes()
public final java.util.ArrayList<EvioNode> getChildNodes()
public final void getAllDescendants(java.util.List<EvioNode> descendants)
descendants
- list to be filled with EvioNodes of all descendantspublic final EvioNode getChildAt(int index)
index
- into list of children.public final int getChildCount()
public final BufferNode getBufferNode()
public final int getLength()
public final int getTotalBytes()
public final int getTag()
public final int getNum()
public final int getPad()
public final int getPosition()
public final int getType()
DataType.getDataType(int)
on the
returned value to get the object representation.public final DataType getTypeObj()
public final int getDataLength()
public final int getDataPosition()
public final int getDataType()
DataType.getDataType(int)
on the
returned value to get the object representation.public final DataType getDataTypeObj()
public final int getEventNumber()
public final boolean isEvent()
true
if this object represents an event,
else false
public final void updateTag(int newTag)
newTag
- new tag valuepublic final void updateNum(int newNum)
newNum
- new num valuepublic final java.nio.ByteBuffer getByteData(boolean copy)
This method is not synchronized.
copy
- if true
, then return a copy as opposed to a
view into this node's buffer.public final int[] getIntData()
getByteData(boolean)
and converting
it to an int array which involves creating additional objects and calling
additional methods.
This method is not synchronized.public final int[] getIntData(int[] intData, int[] length)
getByteData(boolean)
and converting
it to an int array which involves creating additional objects and calling
additional methods.
This method is not synchronized.intData
- integer array in which to store data.length
- set first element to contain number of valid array elements of the returned array.public final long[] getLongData()
getByteData(boolean)
and converting
it to a long array which involves creating additional objects and calling
additional methods.
This method is not synchronized.public final long[] getLongData(long[] longData, int[] length)
getByteData(boolean)
and converting
it to an long array which involves creating additional objects and calling
additional methods.
This method is not synchronized.longData
- long array in which to store data.length
- set first element to contain number of valid array elements of the returned array.public final short[] getShortData()
getByteData(boolean)
and converting
it to a short array which involves creating additional objects and calling
additional methods.
This method is not synchronized.public final short[] getShortData(short[] shortData, int[] length)
getByteData(boolean)
and converting
it to an short array which involves creating additional objects and calling
additional methods.
This method is not synchronized.shortData
- short array in which to store data.length
- set first element to contain number of valid array elements of the returned array.public final java.nio.ByteBuffer getStructureBuffer(boolean copy)
This method is not synchronized.
copy
- if true
, then return a copy as opposed to a
view into this node's buffer.