public class EvioNode
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
(package private) java.util.ArrayList<EvioNode> |
allNodes
List of all nodes in the event including the top-level object
ordered according to placement in buffer.
|
BlockNode |
blockNode
Block containing this node.
|
(package private) BufferNode |
bufferNode
ByteBuffer that this node is associated with.
|
(package private) java.util.ArrayList<EvioNode> |
childNodes
List of child nodes ordered according to placement in buffer.
|
(package private) int[] |
data
Store data in int array form if calculated.
|
(package private) int |
dataLen
Length of node's data in 32-bit words.
|
(package private) int |
dataPos
Position of node's data in file/buffer in bytes.
|
(package private) int |
dataType
Type of data stored in node.
|
(package private) EvioNode |
eventNode
Node of event containing this node.
|
(package private) boolean |
isEvent
Does this node represent an event (top-level bank)?
|
(package private) int |
len
Header's length value (32-bit words).
|
(package private) int |
num
Header's num value.
|
(package private) boolean |
obsolete
If the data this node represents is removed from the buffer,
then this object is obsolete.
|
(package private) int |
pad
Header's padding value.
|
(package private) EvioNode |
parentNode
Node containing this node.
|
(package private) int |
place
Place of containing event in file/buffer.
|
(package private) int |
poolId
If in pool, the pool's id.
|
(package private) int |
pos
Position of header in file/buffer in bytes.
|
(package private) boolean |
scanned
If top-level event node, was I scanned and all my banks
already placed into a list?
|
(package private) int |
tag
Header's tag value.
|
(package private) int |
type
This node's (evio container's) type.
|
Constructor and Description |
---|
EvioNode()
Constructor when fancy features not needed.
|
EvioNode(EvioNode firstNode)
Constructor used when swapping data.
|
EvioNode(int pos,
int place,
BufferNode bufferNode,
BlockNode blockNode)
Constructor which creates an EvioNode associated with
an event (top level) evio container when parsing buffers
for evio data.
|
EvioNode(int tag,
int num,
int pos,
int dataPos,
DataType type,
DataType dataType,
BufferNode bufferNode)
Constructor which creates an EvioNode in the CompactEventBuilder.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addChild(EvioNode node)
Add a child node to the end of the child list and
to the list of all nodes contained in event.
|
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() |
(package private) void |
copyParentForScan(EvioNode parent)
Copy parameters from a parent node when scanning evio data and
placing into EvioNode obtained from an EvioNodeSource.
|
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.
|
(package private) BlockNode |
getBlockNode()
Get the object representing the block header.
|
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?
|
(package private) void |
removeChild(EvioNode node)
Remove a node from this child list and, along with its descendants,
from the list of all nodes contained in event.
|
(package private) void |
setAsEvent(int position,
int place,
BufferNode bufferNode,
BlockNode blockNode) |
(package private) void |
setData(BufferNode bufferNode,
BlockNode blockNode,
EvioNode eventNode,
java.util.ArrayList<EvioNode> allNodes,
boolean obsolete) |
(package private) void |
setData(BufferNode bufferNode,
BlockNode blockNode,
EvioNode eventNode,
EvioNode parentNode,
java.util.ArrayList<EvioNode> allNodes,
int len,
int tag,
int num,
int pad,
int pos,
int type,
int dataLen,
int dataPos,
int dataType) |
(package private) void |
setData(EvioNode parentNode,
int len,
int tag,
int num,
int pad,
int pos,
int type,
int dataLen,
int dataPos,
int dataType) |
(package private) void |
setData(int position,
int place,
BufferNode bufferNode,
BlockNode blockNode) |
(package private) void |
setObsolete(boolean obsolete)
Set whether this node and descendants are now obsolete because the
data they represent in the buffer has 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.
|
int len
int tag
int num
int pad
int pos
int type
int dataLen
int dataPos
int dataType
int[] data
boolean isEvent
boolean obsolete
public BlockNode blockNode
BufferNode bufferNode
java.util.ArrayList<EvioNode> childNodes
int place
boolean scanned
java.util.ArrayList<EvioNode> allNodes
EvioNode eventNode
EvioNode parentNode
int poolId
public EvioNode()
EvioNode(EvioNode firstNode)
firstNode
- node corresponding to event.public EvioNode(int pos, int place, BufferNode bufferNode, 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 eventEvioNode(int tag, int num, int pos, int dataPos, DataType type, DataType dataType, BufferNode bufferNode)
tag
- the tag for the event (or bank) header.num
- the num for the event (or bank) header.pos
- position of event in buffer (bytes).dataPos
- position of event's data in buffer (bytes.)type
- the type of this evio structure.dataType
- the data type contained in this evio event.bufferNode
- buffer containing this event.public final java.lang.Object clone()
clone
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
final void copyParentForScan(EvioNode parent)
parent
- parent of the object.public final void clearLists()
public final void clear()
public final void clearObjects()
public final void clearAll()
public final void clearIntArray()
void setAsEvent(int position, int place, BufferNode bufferNode, BlockNode blockNode)
void setData(int position, int place, BufferNode bufferNode, BlockNode blockNode)
void setData(BufferNode bufferNode, BlockNode blockNode, EvioNode eventNode, java.util.ArrayList<EvioNode> allNodes, boolean obsolete)
void setData(BufferNode bufferNode, BlockNode blockNode, EvioNode eventNode, EvioNode parentNode, java.util.ArrayList<EvioNode> allNodes, int len, int tag, int num, int pad, int pos, int type, int dataLen, int dataPos, int dataType)
void setData(EvioNode parentNode, int len, int tag, int num, int pad, int pos, int type, int dataLen, int dataPos, int dataType)
final void addChild(EvioNode node)
EvioCompactReader.addStructure(int, ByteBuffer)
, the structure or node
gets added at the very end - as the last child of the event.node
- child node to add to the end of the child list.final void removeChild(EvioNode node)
node
- node to remove from child and allNodes lists.final BlockNode getBlockNode()
public final boolean isObsolete()
final void setObsolete(boolean obsolete)
obsolete
- true if node and descendants no longer represent valid
buffer data, else false.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.