|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.arlott.simon.hw.f24.lbsta.Log
public class Log
Maintains a log of events in a limited size list.
| Field Summary | |
|---|---|
private java.util.LinkedList<java.lang.String> |
log
List of log events as strings. |
private int |
maxEntries
Maximum number of log entries. |
private Network |
network
A reference to the Network for the current time. |
| Constructor Summary | |
|---|---|
Log(int maxEntries,
Network network)
Creates a new Log object with the specified maximum number of entries. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.String text)
Adds a string to the log, the time will be prepended automatically. |
void |
clear()
Clears the log. |
java.lang.String[] |
get()
Retrieves the whole log as an array of strings. |
static java.lang.String |
makeTime(long now)
Converts a time in milliseconds to hours, minutes and seconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.LinkedList<java.lang.String> log
private int maxEntries
private Network network
Network for the current time.
| Constructor Detail |
|---|
public Log(int maxEntries,
Network network)
Log object with the specified maximum number of entries.
maxEntries - Maximum number of log entries.network - A reference to the Network.| Method Detail |
|---|
public void add(java.lang.String text)
text - Event text to be added to the log.public java.lang.String[] get()
public void clear()
public static java.lang.String makeTime(long now)
now - The time value.
HH:MM:SS.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||