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, the bank.transform() method will calculate it and set it in the bank 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 serializes 6 bits of data type when being written out while the tag segment serializes 4, only 4 bits are needed to contain the equivalent type data. And, the segment's tag is serialized into 8 bits while the tagsegment's tag uses 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, the transform() method will calculate it and set it in the segment header. Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a segment's tag is written out or serialized into 8 bits will this become an issue since a tagsegment's tag is serialized as 12 bits.
tagsegment
- EvioTagSegment object to transform.public static EvioSegment transform(EvioBank bank) throws EvioException
TAG: Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a segment's tag is written out or serialized into 8 bits will this become an issue since a bank's tag is serialized as 16 bits.
NUM: A segment has no num data and so the bank's num is lost. The bank's num is actually copied into segment header so in that sense it still exists, but will never be written out or serialized.
LENGTH: It is 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
TAG: Tags are stored in a 16 bit int and so this transformation will never lose any tag data. Only when a tagsegment's tag is written out or serialized into 12 bits will this become an issue since a bank's tag is serialized as 16 bits.
NUM: A tagsegment has no num data and so the bank's num is lost. The bank's num is actually copied into tagsegment header so in that sense it still exists, but will never be written out or serialized.
LENGTH: It is possible that the length of the bank (32 bits) is too big for the tagsegment (16 bits). This condition will cause an exception.
TYPE: No data should be lost in this transformaton since even though the bank serializes 6 bits of data type when being written out while the tagsegment serializes 4, only 4 bits are needed to contain the equivalent type data.
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