org.jlab.coda.jevio
Class TagSegmentHeader

java.lang.Object
  extended by org.jlab.coda.jevio.BaseStructureHeader
      extended by org.jlab.coda.jevio.TagSegmentHeader
All Implemented Interfaces:
java.lang.Cloneable, IEvioWriter

public final class TagSegmentHeader
extends BaseStructureHeader

This the the header for an evio tag segment structure (EvioTagSegment). It does not contain the raw data, just the header.

Author:
heddle

Constructor Summary
TagSegmentHeader()
          Null constructor.
TagSegmentHeader(int tag, DataType dataType)
          Constructor.
 
Method Summary
 int getHeaderLength()
          Get the length of the structure's header in ints.
 java.lang.String toString()
          Obtain a string representation of the bank header.
 int write(java.nio.ByteBuffer byteBuffer)
          Write myself out a byte buffer.
 
Methods inherited from class org.jlab.coda.jevio.BaseStructureHeader
byteValue, clone, getDataType, getDataTypeName, getDataTypeValue, getLength, getNumber, getPadding, getTag, setDataType, setLength, setNumber, setTag, shortValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TagSegmentHeader

public TagSegmentHeader()
Null constructor.


TagSegmentHeader

public TagSegmentHeader(int tag,
                        DataType dataType)
Constructor.

Parameters:
tag - the tag for the tag segment header.
dataType - the data type for the content of the tag segment.
Method Detail

getHeaderLength

public int getHeaderLength()
Get the length of the structure's header in ints. This includes the first header word itself (which contains the length) and in the case of banks, it also includes the second header word.

Specified by:
getHeaderLength in class BaseStructureHeader
Returns:
Get the length of the structure's header in ints.

toString

public java.lang.String toString()
Obtain a string representation of the bank header.

Overrides:
toString in class BaseStructureHeader
Returns:
a string representation of the bank header.

write

public int write(java.nio.ByteBuffer byteBuffer)
Write myself out a byte buffer. This write is relative--i.e., it uses the current position of the buffer.

Parameters:
byteBuffer - the byteBuffer to write to.
Returns:
the number of bytes written, which for a TagSegmentHeader is 4.