| Constructor and Description |
|---|
ContextWrapper(Context context)
Creates a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addContextListener(Class<T> type,
ContextListener<T> listener)
Registers a
ContextListener for a specified type. |
<T> T |
find(Class<T> type)
Finds an instance of the specified type in this context.
|
<T> Collection<? extends T> |
findAll(Class<T> type)
Finds all instances of the specified type in this context.
|
<T> void |
removeContextListener(Class<T> type,
ContextListener<T> listener)
Unregisters a
ContextListener for a specified type. |
public ContextWrapper(Context context)
context - the context to wrappublic <T> T find(Class<T> type)
public <T> Collection<? extends T> findAll(Class<T> type)
findAll in interface ContextT - the specified typetype - the specified typeList instead of Collection? <T> instead of <? extends T>?public <T> void addContextListener(Class<T> type, ContextListener<T> listener)
ContextListener for a specified type.
The listener will be notified when instances of the specified type get added or removed.addContextListener in interface ContextT - the specified typetype - the type to listen forlistener - the ContextListenerpublic <T> void removeContextListener(Class<T> type, ContextListener<T> listener)
ContextListener for a specified type.removeContextListener in interface ContextT - the specified typetype - the type to listen forlistener - the ContextListenerCopyright © 2012–2018 Drombler. All rights reserved.