|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--LogRecord
A LogRecord describes a logged event. A LogRecord consists of an event name, an event identifier number, and the time at which the event took place. The identifier number is taken from an internal counter. LogRecords are immutable. That is, once created, they are never changed. LogRecord's implement the Comparable interface so that they can be sorted.
| Constructor Summary | |
LogRecord(java.lang.String event)
Constructor specifying a string description of an event; events are not allowed to contain "newlines" \n. |
|
| Method Summary | |
int |
compareTo(java.lang.Object o)
LogRecords are ordered based first on timestamp, then eventID, and finally event name. |
boolean |
equals(java.lang.Object o)
One LogRecord is equal to another if all of its fields are themselves equal to (using the .equals method) the fields of the other object. |
void |
format(java.io.PrintWriter out)
Creates a string representation of the LogRecord for later retrieval by fromFormat, below. |
static LogRecord |
fromFormat(java.io.BufferedReader in)
Creates a LogRecord from its format representation. |
java.lang.String |
getEvent()
Returns the string event portion of the LogRecord. |
java.util.Date |
getTimestamp()
Returns the time when this LogRecord was created. |
java.lang.String |
toString()
Creates a string representation of the LogRecord suitable for printing. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LogRecord(java.lang.String event)
| Method Detail |
public java.lang.String getEvent()
public java.util.Date getTimestamp()
public java.lang.String toString()
toString in class java.lang.Objectpublic void format(java.io.PrintWriter out)
public static LogRecord fromFormat(java.io.BufferedReader in)
public boolean equals(java.lang.Object o)
equals in class java.lang.Object
public int compareTo(java.lang.Object o)
throws java.lang.ClassCastException
compareTo in interface java.lang.Comparablejava.lang.ClassCastException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||