org.jlab.coda.jevio
Interface IEvioStructure

All Known Implementing Classes:
BaseStructure, EvioBank, EvioEvent, EvioSegment, EvioTagSegment

public interface IEvioStructure

This interface is implemented by classes representing the basic evio structures: banks, segments, and tagsegments. Note there is not "getNum" methods, because not all structures have num fields in their header, only BANKs do.

Author:
heddle

Method Summary
 byte[] getByteData()
          Gets the raw data as an byte array, if the type as indicated by the header is appropriate.
 CompositeData[] getCompositeData()
          Gets the raw data as an array of CompositeData objects, if the type as indicated by the header is appropriate.
 java.lang.String getDescription()
          Get the description from the name provider (dictionary), if there is one.
 double[] getDoubleData()
          Gets the raw data as a double array, if the type as indicated by the header is appropriate.
 float[] getFloatData()
          Gets the raw data as a float array, if the type as indicated by the header is appropriate.
 BaseStructureHeader getHeader()
          Returns the header for this structure
 int[] getIntData()
          Gets the raw data as an integer array, if the type as indicated by the header is appropriate.
 long[] getLongData()
          Gets the raw data as a long array, if the type as indicated by the header is appropriate.
 short[] getShortData()
          Gets the raw data as a short array, if the type as indicated by the header is appropriate.
 java.lang.String[] getStringData()
          Gets the raw data as an array of String objects, if the type as indicated by the header is appropriate.
 StructureType getStructureType()
          Return the StructureType for this structure.
 

Method Detail

getHeader

BaseStructureHeader getHeader()
Returns the header for this structure

Returns:
the BaseStructureHeader for this structure.

getStructureType

StructureType getStructureType()
Return the StructureType for this structure.

Returns:
the StructureType for this structure.
See Also:
StructureType

getIntData

int[] getIntData()
Gets the raw data as an integer array, if the type as indicated by the header is appropriate. NOTE: since Java does not have unsigned primitives, both INT32 and UINT32 data types will be returned as int arrays. The application will have to deal with reinterpreting signed ints that are negative as unsigned ints

Returns:
the data as an int array, or null if this makes no sense for the given type.

getDoubleData

double[] getDoubleData()
Gets the raw data as a double array, if the type as indicated by the header is appropriate.

Returns:
the data as an double array, or null if this makes no sense for the given type.

getByteData

byte[] getByteData()
Gets the raw data as an byte array, if the type as indicated by the header is appropriate. NOTE: since Java does not have unsigned primitives, CHAR8 and UCHAR8 data types will be returned as byte arrays. The application will have to deal with reinterpreting bytes as characters, if necessary.

Returns:
the data as an byte array, or null if this makes no sense for the given type.

getStringData

java.lang.String[] getStringData()
Gets the raw data as an array of String objects, if the type as indicated by the header is appropriate.

Returns:
the data as an array of String objects, or null if this makes no sense for the given type. (The only DataType it makes sense for is CHARSTAR8.)

getLongData

long[] getLongData()
Gets the raw data as a long array, if the type as indicated by the header is appropriate. NOTE: since Java does not have unsigned primitives, both LONG64 and ULONG64 data types will be returned as long arrays. The application will have to deal with reinterpreting signed longs that are negative as unsigned longs.

Returns:
the data as an long array, or null if this makes no sense for the given type.

getFloatData

float[] getFloatData()
Gets the raw data as a float array, if the type as indicated by the header is appropriate.

Returns:
the data as an double array, or null if this makes no sense for the given type.

getShortData

short[] getShortData()
Gets the raw data as a short array, if the type as indicated by the header is appropriate. NOTE: since Java does not have unsigned primitives, both SHORT16 and USHORT16 data types will be returned as short arrays. The application will have to deal with reinterpreting signed shorts that are negative as unsigned shorts.

Returns:
the data as an short array, or null if this makes no sense for the given type.

getCompositeData

CompositeData[] getCompositeData()
                                 throws EvioException
Gets the raw data as an array of CompositeData objects, if the type as indicated by the header is appropriate.

Returns:
the data as an array of CompositeData objects, or null if this makes no sense for the given type.
Throws:
EvioException - if the data is internally inconsistent

getDescription

java.lang.String getDescription()
Get the description from the name provider (dictionary), if there is one.

Returns:
the description from the name provider (dictionary), if there is one. If not, return NameProvider.NO_NAME_STRING.