Package esmska.data
Class Log
- java.lang.Object
-
- esmska.data.Log
-
public class Log extends java.lang.ObjectClass for collecting user-side log messages
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLog.RecordSingle log record
-
Field Summary
Fields Modifier and Type Field Description static intACTION_ADD_RECORDnew record addedstatic intACTION_CLEAR_RECORDSall records deletedstatic intACTION_REMOVE_RECORDexisting record removed
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(java.awt.event.ActionListener actionListener)voidaddRecord(Log.Record record)add new recordvoidclearRecords()delete all recordsstatic LoggetInstance()Get shared instanceLog.RecordgetLastRecord()Get lastly added recordjava.util.List<Log.Record>getRecords()get all records in unmodifiable listbooleanisEmpty()Return if there are no recordsvoidremoveActionListener(java.awt.event.ActionListener actionListener)voidremoveRecord(Log.Record record)remove existing recordintsize()Return number of records
-
-
-
Field Detail
-
ACTION_ADD_RECORD
public static final int ACTION_ADD_RECORD
new record added- See Also:
- Constant Field Values
-
ACTION_REMOVE_RECORD
public static final int ACTION_REMOVE_RECORD
existing record removed- See Also:
- Constant Field Values
-
ACTION_CLEAR_RECORDS
public static final int ACTION_CLEAR_RECORDS
all records deleted- See Also:
- Constant Field Values
-
-
Method Detail
-
addActionListener
public void addActionListener(java.awt.event.ActionListener actionListener)
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener actionListener)
-
getInstance
public static Log getInstance()
Get shared instance
-
getRecords
public java.util.List<Log.Record> getRecords()
get all records in unmodifiable list
-
addRecord
public void addRecord(Log.Record record)
add new record
-
removeRecord
public void removeRecord(Log.Record record)
remove existing record
-
clearRecords
public void clearRecords()
delete all records
-
size
public int size()
Return number of records- Returns:
- See
Collection.size()
-
isEmpty
public boolean isEmpty()
Return if there are no records- Returns:
- See
Collection.isEmpty()
-
getLastRecord
public Log.Record getLastRecord()
Get lastly added record- Returns:
- last record or null if log empty
-
-