public interface ILogMap
| Modifier and Type | Method and Description |
|---|---|
int |
add(ILogEntry log)
Add a log in the map
|
void |
clear()
Clear the Map i.e.
|
void |
deleteLog(java.lang.Integer key)
Remove a log from the Map
|
void |
deleteLogs(java.util.Collection<java.lang.Integer> keys)
Delete a set of logs
|
java.lang.Integer |
getFirstLog()
Return the key of the first valid log (FIFO).
|
int |
getFirstLogs(int n,
java.util.Collection<java.lang.Integer> keys)
Append at most n keys from the first valid logs to the collection.
|
java.lang.Integer |
getLastLog()
Return the key of the last valid log (FIFO)
The key of the last log is the key of the last inserted log
but it can cheang if such log has been deleted
|
ILogEntry |
getLog(java.lang.Integer key)
Return a log eith the given key
|
int |
getSize() |
java.util.Iterator<ILogEntry> |
iterator()
Return an Iterator to browse the logs in the map.
|
java.util.Set<java.lang.Integer> |
keySet()
The keys in the map
|
void |
replaceLog(java.lang.Integer key,
ILogEntry log)
Replace the log in the given position with the new one
|
void clear()
throws LogCacheException
LogCacheExceptionvoid deleteLog(java.lang.Integer key)
throws LogCacheException
key - LogCacheExceptionvoid deleteLogs(java.util.Collection<java.lang.Integer> keys)
throws LogCacheException
keys - The keys of logs to deleteLogCacheExceptionint getSize()
java.util.Set<java.lang.Integer> keySet()
ILogEntry getLog(java.lang.Integer key) throws LogCacheException
key - The key of the logsLogCacheExceptionint add(ILogEntry log) throws LogCacheException
log - The log to add in the mapLogCacheExceptionvoid replaceLog(java.lang.Integer key,
ILogEntry log)
throws LogCacheException
position - The position of the log to replacelog - The key (identifier) ot the logLogCacheExceptionjava.util.Iterator<ILogEntry> iterator()
java.lang.Integer getLastLog()
java.lang.Integer getFirstLog()
int getFirstLogs(int n,
java.util.Collection<java.lang.Integer> keys)
n - The desired number of keys of first logskeys - The collection to add they keys to