public class ServiceCollection extends Object implements Collection, List, Set
Collection, 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 |
|---|
ServiceCollection(Dependency dep)
Creates a Service Collection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Object obj)
Unsupported method.
|
boolean |
add(Object o)
Unsupported method.
|
boolean |
addAll(Collection c)
Unsupported method.
|
boolean |
addAll(int index,
Collection c)
Unsupported method.
|
void |
clear()
Unsupported method.
|
boolean |
contains(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(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.
|
Object |
get(int index)
Gets the object stored at the given index.
|
int |
indexOf(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.
|
Iterator |
iterator()
Gets an iterator on the current list of available service objects.
|
int |
lastIndexOf(Object o)
Gets the last index of the given object in the current
collection.
|
ListIterator |
listIterator()
Gets a list iterator on the current list of available service objects.
|
ListIterator |
listIterator(int index)
Unsupported Method.
|
Object |
remove(int index)
Unsupported method.
|
boolean |
remove(Object o)
Unsupported method.
|
boolean |
removeAll(Collection c)
Unsupported method.
|
boolean |
retainAll(Collection c)
Unsupported method.
|
Object |
set(int arg0,
Object arg1)
Unsupported Method.
|
int |
size()
Gets the number of available providers.
|
List |
subList(int fromIndex,
int toIndex)
Returns a sublist from the current list.
|
Object[] |
toArray()
Returns an array containing available service objects.
|
Object[] |
toArray(Object[] a)
Returns an array containing available service objects.
|
public ServiceCollection(Dependency dep)
dep - the wrapped dependencypublic boolean add(Object o)
add in interface Collectionadd in interface Listadd in interface Seto - an objectCollection.add(java.lang.Object)public boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListaddAll in interface Setc - an objectCollection.addAll(java.util.Collection)public void add(int index,
Object obj)
add in interface Listindex - an indexobj - an objectList.add(int, java.lang.Object)public boolean addAll(int index,
Collection c)
addAll in interface Listindex - an indexc - an objectList.addAll(int, java.util.Collection)public void clear()
clear in interface Collectionclear in interface Listclear in interface SetCollection.clear()public boolean contains(Object o)
contains in interface Collectioncontains in interface Listcontains in interface Seto - the service objecttrue if the object is still available,
false otherwise.Collection.contains(java.lang.Object)public boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface ListcontainsAll in interface Setc - the set of service objecttrue if the objects are still available,
false otherwise.Collection.contains(java.lang.Object)public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListisEmpty in interface Settrue if one provider or more satisfying the
dependency are available. Otherwise, returns falseCollection.isEmpty()public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listiterator in interface SetCollection.iterator()public boolean remove(Object o)
remove in interface Collectionremove in interface Listremove in interface Seto - a objectCollection.remove(java.lang.Object)public Object remove(int index)
remove in interface Listindex - the indexCollection.remove(java.lang.Object)public boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListremoveAll in interface Setc - a set of objectsCollection.removeAll(java.util.Collection)public boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface ListretainAll in interface Setc - a set of objectsCollection.retainAll(java.util.Collection)public int size()
size in interface Collectionsize in interface Listsize in interface SetCollection.size()public Object[] toArray()
toArray in interface CollectiontoArray in interface ListtoArray in interface SetCollection.toArray()public Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListtoArray in interface Seta - 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 Object get(int index)
get in interface Listindex - the indexList.get(int)public int indexOf(Object o)
indexOf in interface Listo - the object-1
if not found.List.indexOf(java.lang.Object)public int lastIndexOf(Object o)
lastIndexOf in interface Listo - the object-1
if not found.List.lastIndexOf(java.lang.Object)public ListIterator listIterator()
listIterator in interface ListList.listIterator()public ListIterator listIterator(int index)
listIterator in interface Listindex - an indexList.listIterator(int)public List subList(int fromIndex, int toIndex)
subList in interface ListfromIndex - the index of the list beginningtoIndex - the index of the list endList.subList(int, int)Copyright © 2012-2013 Adele Team | LIG. All Rights Reserved.