public class ServiceList
extends java.lang.Object
implements java.util.List
Collection or a List, that can be passed to helper objects (Collaborators).
The Collection.iterator() method returns an Iterator iterating
on a cached copy of available service objects. In the case that there are no
available services, the policies act as follows:
| Constructor and Description |
|---|
ServiceList(Dependency dep)
Creates a Service Collection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Object obj)
Unsupported method.
|
boolean |
add(java.lang.Object o)
Unsupported method.
|
boolean |
addAll(java.util.Collection c)
Unsupported method.
|
boolean |
addAll(int index,
java.util.Collection c)
Unsupported method.
|
void |
clear()
Unsupported method.
|
boolean |
contains(java.lang.Object o)
Checks if the wrapped dependency has always access to the
given service object.The method allows knowing if the provider returning the
service object has left.
|
boolean |
containsAll(java.util.Collection c)
Checks if the wrapped dependencies has always access to the
given service objects.The method allows knowing if providers returning the
service objects have left.
|
java.lang.Object |
get(int index)
Gets the object stored at the given index.
|
int |
indexOf(java.lang.Object o)
Gets the index of the given object in the current
collection.
|
boolean |
isEmpty()
Checks if at least one provider matching with the dependency
is available.
|
java.util.Iterator |
iterator()
Gets an iterator on the current list of available service objects.
|
int |
lastIndexOf(java.lang.Object o)
Gets the last index of the given object in the current
collection.
|
java.util.ListIterator |
listIterator()
Gets a list iterator on the current list of available service objects.
|
java.util.ListIterator |
listIterator(int index)
Unsupported Method.
|
java.lang.Object |
remove(int index)
Unsupported method.
|
boolean |
remove(java.lang.Object o)
Unsupported method.
|
boolean |
removeAll(java.util.Collection c)
Unsupported method.
|
boolean |
retainAll(java.util.Collection c)
Unsupported method.
|
java.lang.Object |
set(int arg0,
java.lang.Object arg1)
Unsupported Method.
|
int |
size()
Gets the number of available providers.
|
java.util.List |
subList(int fromIndex,
int toIndex)
Returns a sublist from the current list.
|
java.lang.Object[] |
toArray()
Returns an array containing available service objects.
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an array containing available service objects.
|
public ServiceList(Dependency dep)
dep - the wrapped dependencypublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listo - an objectCollection.add(java.lang.Object)public boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.Listc - an objectCollection.addAll(java.util.Collection)public void add(int index,
java.lang.Object obj)
add in interface java.util.Listindex - an indexobj - an objectList.add(int, java.lang.Object)public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.Listindex - an indexc - an objectList.addAll(int, java.util.Collection)public void clear()
clear in interface java.util.Collectionclear in interface java.util.ListCollection.clear()public boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listo - the service objecttrue if the object is still available,
false otherwise.Collection.contains(java.lang.Object)public boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Listc - the set of service objecttrue if the objects are still available,
false otherwise.Collection.contains(java.lang.Object)public boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Listtrue if one provider or more satisfying the
dependency are available. Otherwise, returns falseCollection.isEmpty()public java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.ListCollection.iterator()public boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Listo - a objectCollection.remove(java.lang.Object)public java.lang.Object remove(int index)
remove in interface java.util.Listindex - the indexCollection.remove(java.lang.Object)public boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Listc - a set of objectsCollection.removeAll(java.util.Collection)public boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Listc - a set of objectsCollection.retainAll(java.util.Collection)public int size()
size in interface java.util.Collectionsize in interface java.util.ListCollection.size()public java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListCollection.toArray()public java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.Lista - the array into which the elements of this collection
are to be stored, if it is big enough; otherwise, a new array
of the same runtime type is allocated for this purpose.Collection.toArray(java.lang.Object[])public java.lang.Object get(int index)
get in interface java.util.Listindex - the indexList.get(int)public int indexOf(java.lang.Object o)
indexOf in interface java.util.Listo - the object-1
if not found.List.indexOf(java.lang.Object)public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.Listo - the object-1
if not found.List.lastIndexOf(java.lang.Object)public java.util.ListIterator listIterator()
listIterator in interface java.util.ListList.listIterator()public java.util.ListIterator listIterator(int index)
listIterator in interface java.util.Listindex - an indexList.listIterator(int)public java.lang.Object set(int arg0,
java.lang.Object arg1)
set in interface java.util.Listarg0 - an indexarg1 - an objectList.set(int, Object)public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.ListfromIndex - the index of the list beginningtoIndex - the index of the list endList.subList(int, int)Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.