|
MetaTF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MetaTF.Runtime.MetaTFState
The state of the reader/writer
Constructor Summary | |
MetaTFState()
|
Method Summary | |
static int |
getCurrentSection(int tag)
Get the appropriate section |
static TraceField |
getTraceField(int s,
int rtag,
int f)
Get TraceField |
static TraceRecord |
getTraceRecord(int s,
int rtag)
Get TraceRecord |
static void |
init(int n,
int f)
Initialise the reader/writer state |
static void |
initRecord(int s,
int r,
int f)
Initialise a Record |
static void |
initSection(int s,
int r)
Initialise a section |
static void |
putSection(LowLevelWriter llw,
int i)
Write section metadata to change current section after changing the current section in the reader/writer |
static Index |
readIndex(LowLevelReader llr,
IndexTraceField tf)
High-level read primitive to read an indexed value according to the field's encoding held in a IndexTraceField |
static java.lang.String |
readln(LowLevelReader llr)
Reads a string with assumed encoding of none e.g. |
static long |
readNum(LowLevelReader llr,
NumTraceField tf)
High-level read primitive to read a number according to the field's encoding held in a NumTraceField |
static int |
readSpecial(LowLevelReader llr)
Try to read a metadata record and adjust the state of the reader/writer accordingly. |
static java.lang.String |
readString(LowLevelReader llr,
StringTraceField tf)
High-level read primitive to read a string according to the field's encoding held in a StringTraceField |
static void |
setField(int s,
int r,
int f,
int i,
TraceField val)
Set a TraceField in the sections/records/fields structure |
static void |
setSection(int i)
Change the current section in the reader/writer |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public MetaTFState()
Method Detail |
public static void init(int n, int f)
n
- the number of sections in the DTDf
- the number of distinct field namespublic static void initSection(int s, int r)
s
- the section numberthe
- number of records in section spublic static void initRecord(int s, int r, int f)
s
- the section numberr
- the record tag (i.e. its number)f
- the number of fieldspublic static void setField(int s, int r, int f, int i, TraceField val)
s
- the section numberr
- the record numberf
- the field numberval
- the TraceFieldpublic static TraceRecord getTraceRecord(int s, int rtag)
s
- the section numberrtag
- the tag of the recordpublic static TraceField getTraceField(int s, int rtag, int f)
s
- the section numberrtag
- the tag of the recordf
- the field numberpublic static int getCurrentSection(int tag)
tag
- the tag that has just been reafpublic static int readSpecial(LowLevelReader llr) throws BadRecordException, java.io.IOException
public static long readNum(LowLevelReader llr, NumTraceField tf) throws BadRecordException, java.io.IOException
tf
- the NumTraceFieldBadRecordException
- IF the encoding is MetaTFConstants.SectionOffset
or MetaTFConstants.SectionStridejava.io.IOException
- IF the read failspublic static java.lang.String readString(LowLevelReader llr, StringTraceField tf) throws BadRecordException, java.io.IOException
tf
- the StringTraceFieldBadRecordException
- IF the encoding is neither MetaTFConstants.None
nor MetaTFConstants.Defaultjava.io.IOException
- IF the read failspublic static java.lang.String readln(LowLevelReader llr) throws BadRecordException, java.io.IOException
public static Index readIndex(LowLevelReader llr, IndexTraceField tf) throws BadRecordException, java.io.IOException
tf
- the IndexTraceFieldBadRecordException
- IF the encoding is neither MetaTFConstants.SectionOffset
MetaTFConstants.SectionStride nor MetaTFConstants.Defaultjava.io.IOException
- IF the read failspublic static void setSection(int i) throws BadRecordException
i
- the new section which must be validBadRecordException
- IF i is an invalid section numberpublic static void putSection(LowLevelWriter llw, int i) throws BadRecordException, java.io.IOException
i
- the new section which must be validBadRecordException
- IF i is an invalid section numberjava.io.IOException
- IF the write fails
|
MetaTF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |