public class FileEventIndex
extends java.lang.Object
Constructor and Description |
---|
FileEventIndex()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventSize(int size)
Adds the number of events in the next record to the index of records.
|
boolean |
advance()
Advances the current event number by one.
|
boolean |
canAdvance()
Checks to see if the event counter reached the end.
|
boolean |
canRetreat()
Checks if the event index can retreat (decrease).
|
void |
clear()
Clear the entire object.
|
int |
getEventNumber()
Gets the current event number which is set by
advance() ,
retreat() or setEvent(int) (which also sets
the record number that the event belongs to). |
int |
getMaxEvents()
Gets the total number of events in file.
|
int |
getRecordEventNumber()
Gets the event number inside the record that corresponds
to the current global event number from the file.
|
int |
getRecordNumber()
Gets the current record number which is set by
setEvent(int) ,
or by using advance() or retreat() (which set the event
number to the next available or previous available respectively). |
static void |
main(java.lang.String[] args) |
void |
resetIndex()
Resets the current index to 0.
|
boolean |
retreat()
Reduces current event number by one.
|
boolean |
setEvent(int event)
Set the current event to the desired position.
|
void |
show()
Prints the content of the event index array on the screen.
|
java.lang.String |
toString() |
public void clear()
public void resetIndex()
public void addEventSize(int size)
size
- number of events in the next record.public int getEventNumber()
advance()
,
retreat()
or setEvent(int)
(which also sets
the record number that the event belongs to).public int getRecordNumber()
setEvent(int)
,
or by using advance()
or retreat()
(which set the event
number to the next available or previous available respectively).public int getRecordEventNumber()
public int getMaxEvents()
public boolean canAdvance()
public boolean advance()
public boolean canRetreat()
public boolean retreat()
public void show()
public boolean setEvent(int event)
event
- event number in the stream, must be 0 to getMaxEvents()-1.public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)