org.jlab.coda.jevio
Class EvioBank

java.lang.Object
  extended by org.jlab.coda.jevio.BaseStructure
      extended by org.jlab.coda.jevio.EvioBank
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, IEvioStructure, IEvioWriter
Direct Known Subclasses:
EvioEvent

public class EvioBank
extends BaseStructure

This holds a CODA Bank structure. Mostly it has a header (a BankHeader) and the raw data stored as an byte array.

Author:
heddle

Field Summary
static java.lang.String ELEMENT_NAME
          The XML record tag for a segment.
 
Constructor Summary
EvioBank()
          Null constructor for a bank.
EvioBank(BankHeader bankHeader)
          Constructor using a provided BankHeader
EvioBank(int tag, DataType dataType, int num)
          This is the general constructor to use for a Bank.
 
Method Summary
 java.lang.Object getAttachment()
          Get the attached object.
 StructureType getStructureType()
          This implements the abstract method from BaseStructure.
 java.lang.String getXMLElementName()
          Get the element name for the bank for writing to XML.
 void setAttachment(java.lang.Object attachment)
          Set the attached object.
 void toXML(javax.xml.stream.XMLStreamWriter xmlWriter)
          Write this bank structure out as an XML record.
 
Methods inherited from class org.jlab.coda.jevio.BaseStructure
appendByteData, appendCompositeData, appendDoubleData, appendFloatData, appendIntData, appendLongData, appendShortData, appendStringData, children, clone, getAllowsChildren, getByteData, getByteOrder, getChildAt, getChildCount, getChildren, getCompositeData, getDescription, getDoubleData, getFloatData, getHeader, getIndex, getIntData, getLongData, getMatchingStructures, getNumberDataItems, getParent, getRawBytes, getShortData, getStringData, getTotalBytes, insert, insert, isContainer, isLeaf, isSwap, remove, remove, removeFromParent, setAllHeaderLengths, setByteData, setByteOrder, setCompositeData, setDoubleData, setFloatData, setIntData, setLongData, setParent, setRawBytes, setShortData, setStringData, setUserObject, stringsToRawBytes, stringsToRawSize, toString, toXML, transform, unpackRawBytesToStrings, vistAllStructures, vistAllStructures, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
The XML record tag for a segment.

See Also:
Constant Field Values
Constructor Detail

EvioBank

public EvioBank()
Null constructor for a bank.


EvioBank

public EvioBank(BankHeader bankHeader)
Constructor using a provided BankHeader

Parameters:
bankHeader - the header to use.
See Also:
BankHeader

EvioBank

public EvioBank(int tag,
                DataType dataType,
                int num)
This is the general constructor to use for a Bank.

Parameters:
tag - the tag for the bank header.
dataType - the (enum) data type for the content of the bank.
num - sometimes, but not necessarily, an ordinal enumeration.
Method Detail

getAttachment

public java.lang.Object getAttachment()
Get the attached object.

Returns:
the attached object

setAttachment

public void setAttachment(java.lang.Object attachment)
Set the attached object.

Parameters:
attachment - object to attach to this bank

getStructureType

public StructureType getStructureType()
This implements the abstract method from BaseStructure. It is a convenience method use instead of "instanceof" to see what type of structure we have. Note: this returns the type of this structure, not the type of data this structure holds.

Specified by:
getStructureType in interface IEvioStructure
Specified by:
getStructureType in class BaseStructure
Returns:
the StructureType of this structure, which is a StructureType.BANK.
See Also:
StructureType

toXML

public void toXML(javax.xml.stream.XMLStreamWriter xmlWriter)
Write this bank structure out as an XML record.

Specified by:
toXML in class BaseStructure
Parameters:
xmlWriter - the writer used to write the events.

getXMLElementName

public java.lang.String getXMLElementName()
Get the element name for the bank for writing to XML.

Specified by:
getXMLElementName in class BaseStructure
Returns:
the element name for the structure for writing to XML.