org.safs.logging
Class LogItemDictionary

java.lang.Object
  extended by org.safs.logging.LogItemDictionary

public class LogItemDictionary
extends java.lang.Object

This is a helper class for log facilities to store their LogItems. This class maps log type indentifier (LOGMODE constant defined by AbstractLogFacility) to a LogItem of that type. This implies that only one LogItem of a particular type can be stored in a LogItemDictionary, which is always the case for log facilities.

See Also:
LogItem, AbstractLogFacility

Constructor Summary
LogItemDictionary()
          Creates an empty LogItemDictionary.
 
Method Summary
 boolean contains(long mode)
          Tests if this dictionary contains LogItem of a type.
 LogItem get(long mode)
          Returns the LogItem of a particular type.
 java.util.Enumeration items()
          Returns an enumeration of all log items.
 LogItem put(LogItem item)
          Adds a LogItem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogItemDictionary

public LogItemDictionary()
Creates an empty LogItemDictionary.

Method Detail

contains

public boolean contains(long mode)
Tests if this dictionary contains LogItem of a type.

Parameters:
mode - the type of the LogItem. One of the LOGMODE constants defined by AbstractLogFacility.
Returns:
true if the LogItem exists. false if not.

get

public LogItem get(long mode)
Returns the LogItem of a particular type.

Parameters:
mode - the type of the LogItem. One of the LOGMODE constants defined by AbstractLogFacility.
Returns:
the LogItem of the specified type; null if this type is not mapped to any item.

put

public LogItem put(LogItem item)
Adds a LogItem. Its type is used as the key.

Parameters:
item - the LogItem to add.
Returns:
the previous LogItem of the same type, or null if there was none.

items

public java.util.Enumeration items()
Returns an enumeration of all log items.

Returns:
an enumeration of all log items.