public abstract class LogRecordsSource<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
LogRecordsSource.Filter<T>
Interface for filtering messages.
|
class |
LogRecordsSource.RegexpFilter<T>
Filter based on regexp matching the toString() of the object
|
| Modifier and Type | Field and Description |
|---|---|
protected List<LogRecordsSource.Filter<T>> |
filters
List of all filters.
|
protected Set<LogRecordListener> |
listeners |
protected LimitedQueue<LogRecord> |
queue
Queue of all log records.
|
| Constructor and Description |
|---|
LogRecordsSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(LogRecordsSource.Filter filter)
Change records filter and notify all listeners.
|
void |
addLogRecordListener(LogRecordListener l) |
protected void |
addMessage(T msg)
Adds new object to queue of objects.
|
void |
clear()
Clears all log records.
|
protected boolean |
filter(T msg) |
protected Collection<LogRecord> |
getFilteredData()
Apply filter to all cached records and return this new collection.
|
protected T |
getLogRecParam(LogRecord lr) |
org.openide.nodes.Sheet.Set |
getPropSet()
Returns property sheet associated with node representing this source.
|
protected void |
notifyLogRecordsListeners(LogRecord r)
Notify all listeners that new record has arrived.
|
void |
notifySetNewData()
Send new data to all listeners.
|
void |
notifySetNewData(LogRecordListener listener)
Send new data to one listeners.
|
void |
removeFilter(LogRecordsSource.Filter filter) |
void |
removeLogRecordListener(LogRecordListener l) |
LogRecordsSource.Filter<T> |
replaceFilter(LogRecordsSource.Filter<T> oldFilter,
LogRecordsSource.Filter<T> newFilter) |
void |
setRegexpFilterPatter(Pattern pattern)
Sets new pattern for regexp filter.
|
protected abstract LogRecord |
toLogRecord(T t)
Format data element as LogRecord.
|
protected List<LogRecordsSource.Filter<T>> filters
protected Set<LogRecordListener> listeners
protected LimitedQueue<LogRecord> queue
public void addLogRecordListener(LogRecordListener l)
public void removeLogRecordListener(LogRecordListener l)
public void clear()
protected void notifyLogRecordsListeners(LogRecord r)
public void notifySetNewData()
public void notifySetNewData(LogRecordListener listener)
protected Collection<LogRecord> getFilteredData()
protected boolean filter(T msg)
public LogRecordsSource.Filter<T> replaceFilter(LogRecordsSource.Filter<T> oldFilter, LogRecordsSource.Filter<T> newFilter)
public void setRegexpFilterPatter(Pattern pattern)
public void addFilter(LogRecordsSource.Filter filter)
filter - new filterpublic void removeFilter(LogRecordsSource.Filter filter)
protected void addMessage(T msg)
public org.openide.nodes.Sheet.Set getPropSet()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.