public abstract class BaseStructureHeader extends java.lang.Object implements java.lang.Cloneable, IEvioWriter
BaseStructure
). It does not contain the raw data, just the
header. The three headers for the actual structures found in evio (BANK, SEGMENT, and TAGSEMENT) all extend this.Constructor and Description |
---|
BaseStructureHeader()
Null constructor.
|
BaseStructureHeader(int tag,
DataType dataType)
Constructor
|
BaseStructureHeader(int tag,
DataType dataType,
int num)
Constructor
|
Modifier and Type | Method and Description |
---|---|
byte |
byteValue(java.lang.Integer integer)
Convenience method to return the byte value of an integer.
|
java.lang.Object |
clone()
Clone this object by passing responsibility to the Object class
which creates a bitwise copy which is fine since all fields are
ints or enums.
|
DataType |
getDataType()
Returns the data type for data stored in this structure as a
DataType enum. |
java.lang.String |
getDataTypeName()
Returns the data type as a string.
|
int |
getDataTypeValue()
Get the data type for the structure.
|
abstract int |
getHeaderLength()
Get the length of the structure's header in ints.
|
int |
getLength()
Get the length of the structure in ints, not counting the length word.
|
int |
getNumber()
Get the number.
|
int |
getPadding()
Get the amount of padding bytes when storing short or byte data.
|
int |
getTag()
Get the structure tag.
|
void |
setDataType(DataType dataType)
Set the numeric data type for the structure.
|
void |
setLength(int length)
Set the length of the structure in ints, not counting the length word.
|
void |
setNumber(int number)
Set the number.
|
void |
setTag(int tag)
Set the structure tag.
|
short |
shortValue(java.lang.Integer integer)
Convenience method to return the short value of an integer.
|
java.lang.String |
toString()
Obtain a string representation of the structure header.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
write
public BaseStructureHeader()
public BaseStructureHeader(int tag, DataType dataType)
tag
- the tag for the header.dataType
- the enum data type for the content of the structure.public BaseStructureHeader(int tag, DataType dataType, int num)
tag
- the tag for the header.dataType
- the data type for the content of the structure.num
- sometimes, but not necessarily, an ordinal enumeration.public java.lang.Object clone()
clone
in class java.lang.Object
public int getNumber()
public void setNumber(int number)
number
- the number.public int getDataTypeValue()
public void setDataType(DataType dataType)
dataType
- the dataTtype for the structure.public DataType getDataType()
DataType
enum.DataType
enum.DataType
public java.lang.String getDataTypeName()
public int getPadding()
public int getLength()
public void setLength(int length)
length
- the length of the structure in ints, not counting the length word.public abstract int getHeaderLength()
public int getTag()
public void setTag(int tag)
tag
- the structure tag.public java.lang.String toString()
toString
in class java.lang.Object
public byte byteValue(java.lang.Integer integer)
integer
- the integer whose byte value is needed. Can pass in a primitive int.public short shortValue(java.lang.Integer integer)
integer
- the integer whose short value is needed. Can pass in a primitive int.