|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcmsc433.p1.NullLog
public class NullLog
A Log that discards all elements added to it. However, listeners should be notified when the add method is called. This class should be thread-safe.
| Constructor Summary | |
|---|---|
NullLog()
|
|
| Method Summary | |
|---|---|
void |
add(LogRecord l)
Stores a LogRecord in the Log. |
java.util.List<LogRecord> |
flush()
Returns all LogRecords kept in the log, emptying the log. |
java.util.List<LogRecord> |
getAll(long windowMS)
Returns all LogRecords whose timestamps are within a window of time. |
void |
register(Listener<LogRecord> l)
Registers a listener that whose notify() method will be called whenever a record is added to this log; the first argument of notify() is the log itself, and the second is the LogRecord that was added. |
java.lang.String |
toString()
|
void |
unregister(Listener<LogRecord> l)
Removes a previously-registered listener. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NullLog()
| Method Detail |
|---|
public void add(LogRecord l)
Log
add in interface Logpublic java.util.List<LogRecord> getAll(long windowMS)
Log
getAll in interface LogwindowMS - return all records from the last [windowMS]
milliseconds.public java.util.List<LogRecord> flush()
Log
flush in interface Logpublic void register(Listener<LogRecord> l)
Log
register in interface Logl - The listener to register.public void unregister(Listener<LogRecord> l)
Log
unregister in interface Logl - The listener to remove. If this listener is
not present, then unregister behaves as a no-op.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 | ||||||||