org.jlab.hipo.io
Class HipoRecordIndex
- java.lang.Object
-
- org.jlab.hipo.io.HipoRecordIndex
-
public class HipoRecordIndex extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description HipoRecordIndex(long offset)Constructor for creating a record index with given position in the file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleangetCompression()returns boolean flag compression.java.util.List<java.lang.Integer>getEventIdex()returns the array containing the indecies of the events in the record.longgetEventPosition(int index)Returns the position of the given event in the record, relative to the start of the file.intgetLength()returns the length of the record, Length includes header length, index array length and data length.intgetNumberOfEvents()returns number of events in the record, this is not necessarily mean that event index will contain the same number of entries.longgetPosition()returns record position relative to the file start.booleanparseHeader(int hL, int hM, int hH)voidsetCompression(boolean isc)Set the compression to the boolean value passed.voidsetLength(int len)Set record length used for reading entire record in.java.lang.StringtoString()returns string representation of the record index
-
-
-
Constructor Detail
-
HipoRecordIndex
public HipoRecordIndex(long offset)
Constructor for creating a record index with given position in the file.- Parameters:
offset- offset relative to the start of the file.
-
-
Method Detail
-
getEventIdex
public java.util.List<java.lang.Integer> getEventIdex()
returns the array containing the indecies of the events in the record. this array should not be used directly. the index offsets are only valid after the record was decompressed (in case of compression).- Returns:
-
parseHeader
public boolean parseHeader(int hL, int hM, int hH)
-
getNumberOfEvents
public int getNumberOfEvents()
returns number of events in the record, this is not necessarily mean that event index will contain the same number of entries. In case the full index is not parsed, the index array will have length=0.- Returns:
-
getEventPosition
public long getEventPosition(int index)
Returns the position of the given event in the record, relative to the start of the file. the record header size and record offset already added to the event offset.- Parameters:
index- event order in the record- Returns:
-
getPosition
public long getPosition()
returns record position relative to the file start.- Returns:
-
setCompression
public void setCompression(boolean isc)
Set the compression to the boolean value passed.- Parameters:
isc- flag indicating weather the record is compressed.
-
getCompression
public boolean getCompression()
returns boolean flag compression.- Returns:
-
setLength
public void setLength(int len)
Set record length used for reading entire record in. Length includes header length, index array length and data length.- Parameters:
len- length in bytes for the record
-
getLength
public int getLength()
returns the length of the record, Length includes header length, index array length and data length.- Returns:
- total length of the record
-
toString
public java.lang.String toString()
returns string representation of the record index- Overrides:
toStringin classjava.lang.Object- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG