|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinput.ExternalEventsQueue
public class ExternalEventsQueue
Queue of external events. This class also takes care of buffering the events and preloading only a proper amount of them.
Field Summary | |
---|---|
static int |
DEFAULT_NROF_PRELOAD
default number of preloaded events |
static java.lang.String |
PATH_SETTING
path of external events file -setting id ("filePath") |
static java.lang.String |
PRELOAD_SETTING
number of event to preload -setting id ("nrofPreload") |
static java.lang.String |
SETTINGS_NAMESPACE
ExternalEvents namespace ("ExternalEvents") |
Constructor Summary | |
---|---|
ExternalEventsQueue(Settings s)
Create a new Queue based on the given settings: PRELOAD_SETTING
and PATH_SETTING . |
|
ExternalEventsQueue(java.lang.String filePath,
int nrofPreload)
Creates a new Queue from a file |
Method Summary | |
---|---|
int |
eventsLeftInBuffer()
Returns the amount of events left in the buffer at the moment (the amount can increase later if more events are read). |
ExternalEvent |
nextEvent()
Returns the next event in the queue or ExternalEvent with time of double.MAX_VALUE if there are no events left |
double |
nextEventsTime()
Returns next event's time or Double.MAX_VALUE if there are no events left |
void |
setNrofPreload(int nrof)
Sets maximum number of events that are read when the next preload occurs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SETTINGS_NAMESPACE
public static final java.lang.String PRELOAD_SETTING
public static final java.lang.String PATH_SETTING
public static final int DEFAULT_NROF_PRELOAD
Constructor Detail |
---|
public ExternalEventsQueue(java.lang.String filePath, int nrofPreload)
filePath
- Path to the file where the events are read from. If
file ends with extension defined in BinaryEventsReader.BINARY_EXT
the file is assumed to be a binary file.nrofPreload
- How many events to preloadBinaryEventsReader.BINARY_EXT
,
BinaryEventsReader.storeToBinaryFile(String, List)
public ExternalEventsQueue(Settings s)
PRELOAD_SETTING
and PATH_SETTING
. The path setting supports value filling.
s
- The settingsMethod Detail |
---|
public void setNrofPreload(int nrof)
nrof
- Maximum number of events to read. If less than 1, default
value ( 500 ) is used.public double nextEventsTime()
nextEventsTime
in interface EventQueue
public ExternalEvent nextEvent()
nextEvent
in interface EventQueue
public int eventsLeftInBuffer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |