T
- public class SortedServiceList<T> extends Object implements List<T>
It is an implementation of List
but is backed by a sorted TreeMap
of <@link ServiceReference, T> where the ServiceReference
objects are what is used to maintain the list order but the
objects passed by this List
to clients are the actual service objects and not
the service references.
For instance if this was a SortedServiceList<@link AuthenticationHandler> object, then in the
internal TreeMap the ServiceReference
objects would be maintained as
keys but AuthenticationHandler objects would be what is passed to clients. Therefore, a call to a
populated SortedServiceList
list such as list.get(0)
would return the first
AuthenticationHandler object.
Constructor and Description |
---|
SortedServiceList()
Constructor accepting OSGi bundle context.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int arg0,
T arg1)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
add(T arg0)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
addAll(Collection<? extends T> arg0)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
addAll(int arg0,
Collection<? extends T> arg1)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
void |
bindPlugin(org.osgi.framework.ServiceReference ref)
Adds the newly bound OSGi service and its service reference to the internally maintained and
sorted serviceMap.
|
void |
clear()
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
contains(Object arg0) |
boolean |
containsAll(Collection<?> arg0) |
T |
get(int arg0) |
protected org.osgi.framework.BundleContext |
getContext() |
int |
indexOf(Object arg0) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object arg0) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int arg0) |
T |
remove(int arg0)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
remove(Object arg0)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
removeAll(Collection<?> arg0)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
boolean |
retainAll(Collection<?> arg0)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
T |
set(int arg0,
T arg1)
Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
|
int |
size() |
List<T> |
subList(int arg0,
int arg1) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] arg0) |
void |
unbindPlugin(org.osgi.framework.ServiceReference ref)
Removes the newly bound OSGi service and its service reference to the internally maintained and
sorted serviceMap.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public SortedServiceList()
protected org.osgi.framework.BundleContext getContext()
public void bindPlugin(org.osgi.framework.ServiceReference ref)
ref
- the OSGi service referencepublic void unbindPlugin(org.osgi.framework.ServiceReference ref)
ref
- the OSGi service referencepublic boolean add(T arg0)
public void add(int arg0, T arg1)
public boolean addAll(Collection<? extends T> arg0)
public boolean addAll(int arg0, Collection<? extends T> arg1)
public void clear()
public boolean contains(Object arg0)
public boolean containsAll(Collection<?> arg0)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
public boolean isEmpty()
public int lastIndexOf(Object arg0)
lastIndexOf
in interface List<T>
public ListIterator<T> listIterator()
listIterator
in interface List<T>
public ListIterator<T> listIterator(int arg0)
listIterator
in interface List<T>
public boolean remove(Object arg0)
public T remove(int arg0)
public boolean removeAll(Collection<?> arg0)
public boolean retainAll(Collection<?> arg0)
public T set(int arg0, T arg1)
public int size()
public Object[] toArray()
This work is licensed under a Creative Commons Attribution 4.0 International License.