sun.security.jca
final class: ProviderList.ServiceList [javadoc |
source]
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList<Service>
sun.security.jca.ProviderList$ServiceList
All Implemented Interfaces:
List, Collection
Inner class for a List of Services. Custom List implementation in
order to delay Provider initialization and lookup.
Not thread safe.
| Methods from java.util.AbstractList: |
|---|
|
add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
| Methods from java.util.AbstractCollection: |
|---|
|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from sun.security.jca.ProviderList$ServiceList Detail: |
public Service get(int index) {
Service s = tryGet(index);
if (s == null) {
throw new IndexOutOfBoundsException();
}
return s;
}
|
public boolean isEmpty() {
return (tryGet(0) == null);
}
|
public Iterator<Service> iterator() {
return new Iterator< Service >() {
int index;
public boolean hasNext() {
return tryGet(index) != null;
}
public Service next() {
Service s = tryGet(index);
if (s == null) {
throw new NoSuchElementException();
}
index++;
return s;
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
|
public int size() {
int n;
if (services != null) {
n = services.size();
} else {
n = (firstService != null) ? 1 : 0;
}
while (tryGet(n) != null) {
n++;
}
return n;
}
|