|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.core.MessageCache
public class MessageCache
MessageCache contains a hashmap of message texts generated by an associated instrument service; each text has associated list of times at which the text occurred. As messages are added, the cache will be written to the service's device log when the cache limit is exceeded.
| Field Summary | |
|---|---|
protected int |
_nOccurrences
Total number of message occurrences |
protected BaseInstrumentService |
_service
Associated instrument service. |
| Constructor Summary | |
|---|---|
MessageCache(BaseInstrumentService service,
int cacheLimit)
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.String msgText,
long timestamp)
Add a message. |
void |
clear()
Clear message counts, but leave message objects in cache for possible later use. |
boolean |
flush()
If cache not empty, write cache entries to service log, then clear cache. |
int |
nOccurrences()
Return count of all message occurences currently in cache. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected BaseInstrumentService _service
protected int _nOccurrences
| Constructor Detail |
|---|
public MessageCache(BaseInstrumentService service,
int cacheLimit)
| Method Detail |
|---|
public void add(java.lang.String msgText,
long timestamp)
public boolean flush()
public int nOccurrences()
public void clear()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||