|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.jevio.EventBuilder
public class EventBuilder
This class is used for creating and manipulating events. One constructor is convenient for creating new events while another is useful for manipulating existing events. You can create a new EventBuilder for each event being handled, However, in many cases one can use the same EventBuilder for all events by calling the setEvent method. The only reason a singleton pattern was not used was to allow for the possibility that events will be built or manipulated on multiple threads.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
appendCharData(BaseStructure structure,
char[] data)
Appends char 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 |
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 |
setEvent(EvioEvent event)
Set the underlying event. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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
public void remove(BaseStructure child) throws EvioException
child
- the child structure to remove.
EvioException
public 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
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
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
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
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
public void appendCharData(BaseStructure structure, char[] data) throws EvioException
structure
- the structure to receive the data, which is appended.data
- the char data to append, or set if there is no existing data.
EvioException
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
public EvioEvent getEvent()
public void setEvent(EvioEvent event)
public static void main(java.lang.String[] args)
args
- ignored command line arguments.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |