public class StationLevelsCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected long |
cacheBaseTimeVal |
protected java.util.Vector |
entriesListObj |
protected StatusLevelTable |
statusLevelTableObj |
protected UsageLevelTable |
usageLevelTableObj |
Constructor and Description |
---|
StationLevelsCache(long baseTimeVal,
StatusLevelTable sLevelTableObj,
UsageLevelTable uLevelTableObj)
Creates a cache of station-levels entry objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(long timeVal,
StatusLevelTag sLevelObj,
UsageLevelTag uLevelObj)
Adds an entry to the cache.
|
StationLevelsEntry |
get(int idx)
Fetches the entry object at the given index in the cache.
|
java.lang.String |
getLevelsAtTimeStr(long timeVal)
Returns a string containing the status and usage level names
for the given time value.
|
void |
purgeOldEntries(long timeVal)
Purges entries from the cache that are older than the given time value.
|
int |
size()
Returns the number of entries in the cache.
|
protected final long cacheBaseTimeVal
protected final StatusLevelTable statusLevelTableObj
protected final UsageLevelTable usageLevelTableObj
protected final java.util.Vector entriesListObj
public StationLevelsCache(long baseTimeVal, StatusLevelTable sLevelTableObj, UsageLevelTable uLevelTableObj)
baseTimeVal
- base time value for cache (seconds since 1/1/1970).sLevelTableObj
- status-level table for cache.uLevelTableObj
- usage-level table for cache.public void addEntry(long timeVal, StatusLevelTag sLevelObj, UsageLevelTag uLevelObj) throws java.lang.IllegalArgumentException
timeVal
- time value associated with levels (seconds since
1/1/1970).sLevelObj
- status-level object.uLevelObj
- usage-level object.java.lang.IllegalArgumentException
- if index value for given status or
usage level is out of range.public java.lang.String getLevelsAtTimeStr(long timeVal)
timeVal
- requested time value (seconds since 1/1/1970).public void purgeOldEntries(long timeVal)
timeVal
- purge time value (seconds since 1/1/1970).public int size()
public StationLevelsEntry get(int idx)
idx
- index value to use.