Class Overview
Various utilities for debugging and logging.
Summary
Public Methods |
static
boolean
|
isObjectSelected(Object object)
Filters objects against the ANDROID_OBJECT_FILTER
environment variable.
|
[Expand]
Inherited Methods |
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Is called before the object's memory is being reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class which represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
Public Constructors
Public Methods
public
static
boolean
isObjectSelected
(Object object)
Filters objects against the ANDROID_OBJECT_FILTER
environment variable. This environment variable can filter objects
based on their class name and attribute values.
Here is the syntax for ANDROID_OBJECT_FILTER
:
ClassName@attribute1=value1@attribute2=value2...
Examples:
- Select TextView instances:
TextView
- Select TextView instances of text "Loading" and bottom offset of 22:
TextView@text=Loading.*@bottom=22
The class name and the values are regular expressions.
This class is useful for debugging and logging purpose:
if (Config.DEBUG) {
if (DebugUtils.isObjectSelected(childView) && Config.LOGV) {
Log.v(TAG, "Object " + childView + " logged!");
}
}
NOTE: This method is very expensive as it relies
heavily on regular expressions and reflection. Calls to this method
should always be stripped out of the release binaries and avoided
as much as possible in debug mode.
Parameters
object
| any object to match against the ANDROID_OBJECT_FILTER
environement variable |
Returns
- true if object is selected by the ANDROID_OBJECT_FILTER
environment variable, false otherwise