|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
de.infinityloop.util.log.NotificationCollector
public class NotificationCollector
A NotificationCollector is used for globally collecting notifications, errors, warnings over the app's run to be able to identify them later in some collected form for evaluation.
Field Summary | |
---|---|
static int |
DEBUG
|
static int |
ERROR
|
static int |
FATAL
|
static int |
INFO
|
static int |
WARN
|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
NotificationCollector()
Constructor |
Method Summary | |
---|---|
void |
add(int type,
int code,
java.lang.String message,
java.lang.Object[] params,
java.lang.Throwable t)
Add a log message |
void |
clear()
Clears all collected notifications. |
int |
countType(int type)
Counts the number of messages in this collection of the respective type |
int |
getCode(int i)
|
java.lang.Throwable |
getEmbeddedException(int i)
|
java.lang.String |
getMessage(int i)
|
java.util.ArrayList |
getNotifications()
Returns the collected notifications |
int |
getType(int i)
|
java.lang.Object |
getUserRef()
Retrieves an earlier set user data object |
void |
setThreshold(int level)
Sets this notification collector's filter threshold to the specified value. |
void |
setUserRef(java.lang.Object ref)
Sets an arbitrary object to e.g. store associated user data |
java.lang.String |
toString()
human readable representation of the collected notifications |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Field Detail |
---|
public static final int WARN
public static final int ERROR
public static final int FATAL
public static final int DEBUG
public static final int INFO
Constructor Detail |
---|
public NotificationCollector()
Method Detail |
---|
public void add(int type, int code, java.lang.String message, java.lang.Object[] params, java.lang.Throwable t)
type
- one of the constants DEBUG, INFO, WARN, ERROR, FATALcode
- the errorcodemessage
- the plain text messaget
- an associated exceptionpublic java.util.ArrayList getNotifications()
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.ArrayList
public void setThreshold(int level)
level
- the threshold levelpublic void setUserRef(java.lang.Object ref)
ref
- the object to setpublic java.lang.Object getUserRef()
public java.lang.Throwable getEmbeddedException(int i) throws java.lang.ArrayIndexOutOfBoundsException
i
- index in list of entries
java.lang.ArrayIndexOutOfBoundsException
- when the index is out of boundspublic int getCode(int i) throws java.lang.ArrayIndexOutOfBoundsException
i
- index in list of entries
java.lang.ArrayIndexOutOfBoundsException
- when the index is out of boundspublic java.lang.String getMessage(int i) throws java.lang.ArrayIndexOutOfBoundsException
i
- index in list of entries
java.lang.ArrayIndexOutOfBoundsException
- when the index is out of boundspublic int getType(int i) throws java.lang.ArrayIndexOutOfBoundsException
i
- index in list of entries
java.lang.ArrayIndexOutOfBoundsException
- when the index is out of boundspublic int countType(int type)
type
- one of the types
public java.lang.String toString()
toString
in class java.util.AbstractCollection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |