org.jlab.coda.jevio
Class BankHeader

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

public final class BankHeader
extends BaseStructureHeader

This the header for an evio bank structure (EvioBank). It does not contain the raw data, just the header. Note: since an "event" is really just the outermost bank, this is also the header for an EvioEvent.

Author:
heddle

Constructor Summary
BankHeader()
          Null constructor.
BankHeader(int tag, DataType dataType, int num)
          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

BankHeader

public BankHeader()
Null constructor.


BankHeader

public BankHeader(int tag,
                  DataType dataType,
                  int num)
Constructor

Parameters:
tag - the tag for the bank header.
dataType - the data type for the content of the bank.
num - sometimes, but not necessarily, an ordinal enumeration.
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 BankHeader is 8.