public class StructureTransformer
extends java.lang.Object
Constructor and Description |
---|
StructureTransformer() |
Modifier and Type | Method and Description |
---|---|
static EvioSegment |
transform(EvioBank bank)
Create an EvioSegment object from an EvioBank.
|
static EvioTagSegment |
transform(EvioBank bank,
int dummy)
Create an EvioTagSegment object from an EvioBank.
|
static EvioTagSegment |
transform(EvioSegment segment)
Create an EvioTagSegment object from an EvioSegment.
|
static EvioBank |
transform(EvioSegment segment,
int num)
Create an EvioBank object from an EvioSegment.
|
static EvioSegment |
transform(EvioTagSegment tagsegment)
Create an EvioSegment object from an EvioTagSegment.
|
static EvioBank |
transform(EvioTagSegment tagsegment,
int num)
Create an EvioBank object from an EvioTagSegment.
|
public static EvioBank transform(EvioSegment segment, int num)
segment
- EvioSegment object to transform.num
- num of the created EvioBank.public static EvioBank transform(EvioTagSegment tagsegment, int num)
NOTE: A tagsegment has no associated padding data. However, if a tagsegment is read from a file/buffer, padding info is already lost (=0), and if a tagsegment is created "by hand", the padding has already been calculated and exists in the header.
tagsegment
- EvioTagSegment object to transform.num
- num of the created EvioBank.public static EvioTagSegment transform(EvioSegment segment)
NOTE: No data should be lost in this transformaton since even though the segment has 6 bits of data type while the tag segment has only 4, only 4 bits are needed to contain the type data. And, the segment's tag is 8 bits while the tagsegment's tag is 12 bits so no problem there.
segment
- EvioSegment object to transform.public static EvioSegment transform(EvioTagSegment tagsegment)
NOTE: A tagsegment has no associated padding data. However, if a tagsegment is read from a file/buffer, padding info is already lost (=0), and if a tagsegment is created "by hand", the padding has already been calculated and exists in the header. It is also possible that data is lost in this transformaton since the segment's tag is 8 bits while the tagsegment's tag is 12 bits. The user can override the truncation of the tagsegment's tag and simply set the created segment's tag by calling segment.getHeader().setTag(tag).
tagsegment
- EvioTagSegment object to transform.public static EvioSegment transform(EvioBank bank) throws EvioException
NOTE: It is possible that data is lost in this transformaton since the segment's tag is 8 bits while the bank's tag is 16 bits. To override the truncation of the tag, simply set the created segment's tag by calling segment.getHeader().setTag(tag). It is also possible that the length of the bank (32 bits) is too big for the segment (16 bits). This condition will cause an exception.
bank
- EvioBank object to transform.EvioException
- if the bank is too long to change into a segmentpublic static EvioTagSegment transform(EvioBank bank, int dummy) throws EvioException
NOTE: It is possible that data is lost in this transformaton since the tagsegment's tag is 12 bits while the bank's tag is 16 bits. To override the truncation of the tag, simply set the created tagsegment's tag by calling tagsegment.getHeader().setTag(tag). It is also possible that the length of the bank (32 bits) is too big for the tagsegment (16 bits). This condition will cause an exception.
bank
- EvioBank object to transform.dummy
- only used to distinguish this method from transform(EvioBank)
.EvioException
- if the bank is too long to change into a tagsegment