|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
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 |
setEvent(EvioEvent event)
Set the underlying event. |
void |
setFloatData(BaseStructure structure,
float[] data)
Set float data to the structure. |
void |
setIntData(BaseStructure structure,
double[] data)
Set double 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. |
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
- 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
public 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 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 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 setIntData(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 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 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 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
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 |