Public Member Functions

com.cosylab.logging.client.cache.ILogMap Interface Reference

Inheritance diagram for com.cosylab.logging.client.cache.ILogMap:
com.cosylab.logging.client.cache.LogBufferedFileCache com.cosylab.logging.client.cache.LogCache com.cosylab.logging.client.cache.LogFileCache com.cosylab.logging.client.cache.LogMultiFileCache com.cosylab.logging.client.cache.LogBufferedFileCache com.cosylab.logging.client.cache.LogCache

List of all members.

Public Member Functions

void clear () throws LogCacheException
void deleteLog (Integer key) throws LogCacheException
void deleteLogs (Collection< Integer > keys) throws LogCacheException
int getSize ()
Set< Integer > keySet ()
ILogEntry getLog (Integer key) throws LogCacheException
int add (ILogEntry log) throws LogCacheException
void replaceLog (Integer key, ILogEntry log) throws LogCacheException
Iterator< ILogEntryiterator ()
Integer getLastLog ()
Integer getFirstLog ()
int getFirstLogs (int n, Collection< Integer > keys)

Detailed Description

The interface with the methods for the map of logs. The cache is implementing this interface.

Author:
acaproni

Member Function Documentation

int com.cosylab.logging.client.cache.ILogMap.add ( ILogEntry  log  )  throws LogCacheException

Add a log in the map

Parameters:
log The log to add in the map
Returns:
The key of the added log
Exceptions:
LogCacheException 

Implemented in com.cosylab.logging.client.cache.LogBufferedFileCache, com.cosylab.logging.client.cache.LogCache, com.cosylab.logging.client.cache.LogFileCache, and com.cosylab.logging.client.cache.LogMultiFileCache.

void com.cosylab.logging.client.cache.ILogMap.clear (  )  throws LogCacheException
void com.cosylab.logging.client.cache.ILogMap.deleteLog ( Integer  key  )  throws LogCacheException
void com.cosylab.logging.client.cache.ILogMap.deleteLogs ( Collection< Integer >  keys  )  throws LogCacheException
Integer com.cosylab.logging.client.cache.ILogMap.getFirstLog (  ) 

Return the key of the first valid log (FIFO). The key of the first log is 0 but it can change if the log 0 has been deleted.

Returns:
The key of the first log null if the cache is empty

Implemented in com.cosylab.logging.client.cache.LogBufferedFileCache, com.cosylab.logging.client.cache.LogFileCache, and com.cosylab.logging.client.cache.LogMultiFileCache.

Referenced by com.cosylab.logging.client.cache.LogIterator.next().

int com.cosylab.logging.client.cache.ILogMap.getFirstLogs ( int  n,
Collection< Integer >  keys 
)

Append at most n keys from the first valid logs to the collection. First here means first in the FIFO policy.

The number of added keys can be less then n if the cache doesn't contain enough logs.

Parameters:
n The desired number of keys of first logs
keys The collection to add they keys to
Returns:
The number of keys effectively added

Implemented in com.cosylab.logging.client.cache.LogBufferedFileCache, com.cosylab.logging.client.cache.LogFileCache, and com.cosylab.logging.client.cache.LogMultiFileCache.

Integer com.cosylab.logging.client.cache.ILogMap.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

Returns:
The key of the last inserted log null if th cache is empty

Implemented in com.cosylab.logging.client.cache.LogBufferedFileCache, com.cosylab.logging.client.cache.LogFileCache, and com.cosylab.logging.client.cache.LogMultiFileCache.

Referenced by com.cosylab.logging.client.cache.LogIterator.hasNext(), and com.cosylab.logging.client.cache.LogIterator.next().

ILogEntry com.cosylab.logging.client.cache.ILogMap.getLog ( Integer  key  )  throws LogCacheException
int com.cosylab.logging.client.cache.ILogMap.getSize (  ) 
Iterator<ILogEntry> com.cosylab.logging.client.cache.ILogMap.iterator (  ) 

Return an Iterator to browse the logs in the map. The order the iterator returns the logs is that of the keys.

Returns:
an Iterator over the elements in this map

Implemented in com.cosylab.logging.client.cache.LogBufferedFileCache, com.cosylab.logging.client.cache.LogCache, com.cosylab.logging.client.cache.LogFileCache, and com.cosylab.logging.client.cache.LogMultiFileCache.

Set<Integer> com.cosylab.logging.client.cache.ILogMap.keySet (  ) 
void com.cosylab.logging.client.cache.ILogMap.replaceLog ( Integer  key,
ILogEntry  log 
) throws LogCacheException

Replace the log in the given position with the new one

Parameters:
position The position of the log to replace
log The key (identifier) ot the log

Implemented in com.cosylab.logging.client.cache.LogBufferedFileCache, com.cosylab.logging.client.cache.LogFileCache, and com.cosylab.logging.client.cache.LogMultiFileCache.


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties