esmska.data
Class Log

java.lang.Object
  extended by esmska.data.Log

public class Log
extends java.lang.Object

Class for collecting user-side log messages


Nested Class Summary
static class Log.Record
          Single log record
 
Field Summary
static int ACTION_ADD_RECORD
          new record added
static int ACTION_CLEAR_RECORDS
          all records deleted
static int ACTION_REMOVE_RECORD
          existing record removed
 
Method Summary
 void addActionListener(java.awt.event.ActionListener actionListener)
           
 void addRecord(Log.Record record)
          add new record
 void clearRecords()
          delete all records
static Log getInstance()
          Get shared instance
 Log.Record getLastRecord()
          Get lastly added record
 java.util.List<Log.Record> getRecords()
          get all records in unmodifiable list
 boolean isEmpty()
          Return if there are no records
 void removeActionListener(java.awt.event.ActionListener actionListener)
           
 void removeRecord(Log.Record record)
          remove existing record
 int size()
          Return number of records
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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