public class EventBuilder
extends java.lang.Object
Constructor and Description |
---|
EventBuilder(EvioEvent event)
This is the constructor to use when you want to manipulate an existing event.
|
EventBuilder(int tag,
DataType dataType,
int num)
This is the constructor to use for an EventBuilder object that will operate on a new, empty event.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(BaseStructure parent,
BaseStructure child)
Add a child to a parent structure.
|
void |
appendByteData(BaseStructure structure,
byte[] data)
Appends byte data to the structure.
|
void |
appendDoubleData(BaseStructure structure,
double[] data)
Appends double data to the structure.
|
void |
appendFloatData(BaseStructure structure,
float[] data)
Appends float data to the structure.
|
void |
appendIntData(BaseStructure structure,
int[] data)
Appends int data to the structure.
|
void |
appendLongData(BaseStructure structure,
long[] data)
Appends long data to the structure.
|
void |
appendShortData(BaseStructure structure,
short[] data)
Appends short data to the structure.
|
void |
appendStringData(BaseStructure structure,
java.lang.String data)
Appends string data to the structure.
|
void |
clearData(BaseStructure structure)
This clears all the data fields in a structure, but not the parent or the children.
|
EvioEvent |
getEvent()
Get the underlying event.
|
static void |
main(java.lang.String[] args)
Main program for testing.
|
void |
remove(BaseStructure child)
This removes a structure (and all its descendants) from the tree.
|
void |
setAllHeaderLengths()
This goes through the event recursively, and makes sure all the length fields
in the headers are properly set.
|
void |
setByteData(BaseStructure structure,
byte[] data)
Set byte data to the structure.
|
void |
setDoubleData(BaseStructure structure,
double[] data)
Set double data to the structure.
|
void |
setEvent(EvioEvent event)
Set the underlying event.
|
void |
setFloatData(BaseStructure structure,
float[] data)
Set float data to the structure.
|
void |
setIntData(BaseStructure structure,
int[] data)
Set int data to the structure.
|
void |
setLongData(BaseStructure structure,
long[] data)
Set long data to the structure.
|
void |
setShortData(BaseStructure structure,
short[] data)
Set short data to the structure.
|
void |
setStringData(BaseStructure structure,
java.lang.String[] data)
Set string data to the structure.
|
public EventBuilder(int tag, DataType dataType, int num)
tag
- the tag for the event header (which is just a bank header).dataType
- the data type for the event object--which again is just the type for the outer most
bank. Often an event is a bank of banks, so typically this will be DataType.BANK, or 0xe (14).num
- often an ordinal enumeration.public EventBuilder(EvioEvent event)
event
- the event to manipulate.public void setAllHeaderLengths()
public void clearData(BaseStructure structure)
remove
structure
- the segment to clear.public void addChild(BaseStructure parent, BaseStructure child) throws EvioException
parent
- the parent structure.child
- the child structure.EvioException
- if parent or child is null, child has wrong byte order,
is wrong structure type, or parent is not a containerpublic void remove(BaseStructure child) throws EvioException
child
- the child structure to remove.EvioException
- if arg is null or its parent is nullpublic void setIntData(BaseStructure structure, int[] data) throws EvioException
structure
- the structure to receive the data.data
- the int data to write.EvioException
- if structure arg is nullpublic void setShortData(BaseStructure structure, short[] data) throws EvioException
structure
- the structure to receive the data.data
- the short data to write.EvioException
- if structure arg is nullpublic void setLongData(BaseStructure structure, long[] data) throws EvioException
structure
- the structure to receive the data.data
- the long data to write.EvioException
- if structure arg is nullpublic void setByteData(BaseStructure structure, byte[] data) throws EvioException
structure
- the structure to receive the data.data
- the byte data to write.EvioException
- if structure arg is nullpublic void setFloatData(BaseStructure structure, float[] data) throws EvioException
structure
- the structure to receive the data.data
- the float data to write.EvioException
- if structure arg is nullpublic void setDoubleData(BaseStructure structure, double[] data) throws EvioException
structure
- the structure to receive the data.data
- the double data to write.EvioException
- if structure arg is nullpublic void setStringData(BaseStructure structure, java.lang.String[] data) throws EvioException
structure
- the structure to receive the data.data
- the string data to write.EvioException
- if structure arg is nullpublic void appendIntData(BaseStructure structure, int[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the int data to append, or set if there is no existing data.EvioException
- if structure arg is null.public void appendShortData(BaseStructure structure, short[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the short data to append, or set if there is no existing data.EvioException
- if structure arg is null.public void appendLongData(BaseStructure structure, long[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the long data to append, or set if there is no existing data.EvioException
- if structure arg is null.public void appendByteData(BaseStructure structure, byte[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the byte data to append, or set if there is no existing data.EvioException
- if structure arg is null.public void appendFloatData(BaseStructure structure, float[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the float data to append, or set if there is no existing data.EvioException
- if structure arg is null.public void appendDoubleData(BaseStructure structure, double[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the double data to append, or set if there is no existing data.EvioException
- if structure arg is null.public void appendStringData(BaseStructure structure, java.lang.String data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the string to append, or set if there is no existing data.EvioException
- if structure arg is null.public EvioEvent getEvent()
public void setEvent(EvioEvent event)
event
- the new underlying event.public static void main(java.lang.String[] args)
args
- ignored command line arguments.