|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.bristol.star.cdf.record.Record
public abstract class Record
Abstract superclass for a CDF Record object. A Record represents one of the sequence of typed records of which a CDF file is composed.
Constructor Summary | |
---|---|
protected |
Record(RecordPlan plan,
java.lang.String abbrev)
Constructs a record with no known record type. |
protected |
Record(RecordPlan plan,
java.lang.String abbrev,
int fixedType)
Constructs a record with a known record type. |
Method Summary | |
---|---|
protected void |
checkEndRecord(Pointer ptr)
Checks that a pointer is positioned at the end of this record. |
protected int |
checkIntValue(int actualValue,
int fixedValue)
Checks that an integer has a known fixed value. |
Buf |
getBuf()
Returns the buffer containing the record data. |
long |
getContentOffset()
Returns the buffer offset of the first field in this record after the record size and type values. |
long |
getRecordSize()
Returns the size of the record in bytes. |
int |
getRecordType()
Returns the type code identifying what kind of CDF record it is. |
java.lang.String |
getRecordTypeAbbreviation()
Returns the abbreviated form of the record type for this record. |
static boolean |
hasBit(int flags,
int ibit)
Indicates whether a given bit of a flags mask is set. |
static int[] |
readIntArray(Buf buf,
Pointer ptr,
int count)
Reads a moderately-sized array of 4-byte big-endian integers. |
static long[] |
readOffsetArray(Buf buf,
Pointer ptr,
int count)
Reads a moderately-sized offset 8-byte big-endian integers. |
static java.lang.String[] |
toLines(java.lang.String text)
Splits an ASCII string into 0x0A-terminated lines. |
protected void |
warnFormat(java.lang.String msg)
Called by check* methods to issue a warning if the
check has failed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Record(RecordPlan plan, java.lang.String abbrev)
plan
- basic record informationabbrev
- abreviated name for record typeprotected Record(RecordPlan plan, java.lang.String abbrev, int fixedType)
plan
- basic record informationabbrev
- abreviated name for record typefixedType
- record type asserted for this recordMethod Detail |
---|
public long getRecordSize()
public int getRecordType()
public Buf getBuf()
public java.lang.String getRecordTypeAbbreviation()
public long getContentOffset()
protected int checkIntValue(int actualValue, int fixedValue)
actualValue
- value to testfixedValue
- value to compare against
actualValue
protected void checkEndRecord(Pointer ptr)
ptr
- pointer notionally positioned at end of recordprotected void warnFormat(java.lang.String msg)
check*
methods to issue a warning if the
check has failed.
msg
- message to outputpublic static int[] readIntArray(Buf buf, Pointer ptr, int count) throws java.io.IOException
buf
- bufferptr
- pointercount
- number of values to read
count
-element array of values
java.io.IOException
public static long[] readOffsetArray(Buf buf, Pointer ptr, int count) throws java.io.IOException
buf
- bufferptr
- pointercount
- number of values to read
count
-element array of values
java.io.IOException
public static java.lang.String[] toLines(java.lang.String text)
text
- string containing ASCII characters
public static boolean hasBit(int flags, int ibit)
flags
- flags maskibit
- bit index; 0 is the least significant
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |