|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<T>
edu.rice.cs.plt.collect.DelegatingCollection<T>
public class DelegatingCollection<T>
A collection that delegates all operations to a wrapped collection. Subclasses can be defined
that override a few of the methods, while maintaining the default delegation behavior in most cases.
Since instances of this class must not be equal to some collections (such as Sets
and Lists -- allowing the equivalence would violate symmetry), the equals() and
hashCode() methods are not implemented, and inherit the Object defaults.
Subclasses can also invoke the overridden methods in AbstractCollection to use the
default implementations there by invoking, for example, abstractCollectionAddAll(java.util.Collection extends T>)
(see AbstractCollection for details on the default implementations).
| Field Summary | |
|---|---|
protected java.util.Collection<T> |
_delegate
|
| Constructor Summary | |
|---|---|
DelegatingCollection(java.util.Collection<T> delegate)
|
|
| Method Summary | ||
|---|---|---|
protected boolean |
abstractCollectionAddAll(java.util.Collection<? extends T> c)
|
|
protected void |
abstractCollectionClear()
|
|
protected boolean |
abstractCollectionContains(java.lang.Object o)
|
|
protected boolean |
abstractCollectionContainsAll(java.util.Collection<?> c)
|
|
protected boolean |
abstractCollectionIsEmpty()
|
|
protected boolean |
abstractCollectionRemove(T o)
|
|
protected boolean |
abstractCollectionRemoveAll(java.util.Collection<?> c)
|
|
protected boolean |
abstractCollectionRetainAll(java.util.Collection<?> c)
|
|
protected java.lang.Object[] |
abstractCollectionToArray()
|
|
protected
|
abstractCollectionToArray(S[] a)
|
|
boolean |
add(T o)
|
|
boolean |
addAll(java.util.Collection<? extends T> c)
|
|
void |
clear()
|
|
int |
compositeHeight()
Get the maximum path length from this node to a leaf. |
|
int |
compositeSize()
Get the number of nodes in the tree rooted at this node. |
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
hasFixedSize()
true if this iterable is known to have a fixed size. |
|
boolean |
isEmpty()
Whether the iterable does not contain any elements. |
|
boolean |
isInfinite()
true if the iterable is known to have infinite size. |
|
boolean |
isStatic()
true if this iterable is unchanging. |
|
java.util.Iterator<T> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
int |
size()
Compute the number of elements in the iterable. |
|
int |
size(int bound)
Compute the number of elements in the iterable, up to the given bound. |
|
java.lang.Object[] |
toArray()
|
|
|
toArray(S[] a)
|
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
equals, hashCode |
| Field Detail |
|---|
protected java.util.Collection<T> _delegate
| Constructor Detail |
|---|
public DelegatingCollection(java.util.Collection<T> delegate)
| Method Detail |
|---|
public int compositeHeight()
Composite
compositeHeight in interface Compositepublic int compositeSize()
Composite
compositeSize in interface Compositepublic boolean isEmpty()
SizedIterable
isEmpty in interface SizedIterable<T>isEmpty in interface java.util.Collection<T>isEmpty in class java.util.AbstractCollection<T>public int size()
SizedIterableint, Integer.MAX_VALUE should be returned. Otherwise, next() may be safely invoked
on the iterator exactly this number of times.
size in interface SizedIterable<T>size in interface java.util.Collection<T>size in class java.util.AbstractCollection<T>public int size(int bound)
SizedIterablebound, bound is returned.
size in interface SizedIterable<T>bound - Maximum result. Assumed to be nonnegative.public boolean isInfinite()
SizedIterabletrue if the iterable is known to have infinite size. If true, an iterator over the iterable in its
current state will never return false from hasNext().
isInfinite in interface SizedIterable<T>public boolean hasFixedSize()
SizedIterabletrue if this iterable is known to have a fixed size. This is the case if the iterable is immutable,
or if changes can only replace values, not remove or add them. An infinite iterable may be fixed if it
is guaranteed to never become finite.
hasFixedSize in interface SizedIterable<T>public boolean isStatic()
SizedIterabletrue if this iterable is unchanging. This implies that hasFixedSize() is true, and that
iterator() will always return the same (either == or equal() and immutable) elements
in the same order. ("Immutable" here means that equals() invocations are consistent over time -- if
two objects are equal, they will never become inequal, and vice versa.)
isStatic in interface SizedIterable<T>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<T>contains in class java.util.AbstractCollection<T>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<T>containsAll in class java.util.AbstractCollection<T>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>iterator in class java.util.AbstractCollection<T>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<T>toArray in class java.util.AbstractCollection<T>public <S> S[] toArray(S[] a)
toArray in interface java.util.Collection<T>toArray in class java.util.AbstractCollection<T>public boolean add(T o)
add in interface java.util.Collection<T>add in class java.util.AbstractCollection<T>public boolean addAll(java.util.Collection<? extends T> c)
addAll in interface java.util.Collection<T>addAll in class java.util.AbstractCollection<T>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<T>remove in class java.util.AbstractCollection<T>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<T>retainAll in class java.util.AbstractCollection<T>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<T>removeAll in class java.util.AbstractCollection<T>public void clear()
clear in interface java.util.Collection<T>clear in class java.util.AbstractCollection<T>public java.lang.String toString()
toString in class java.util.AbstractCollection<T>protected boolean abstractCollectionIsEmpty()
protected boolean abstractCollectionContains(java.lang.Object o)
protected java.lang.Object[] abstractCollectionToArray()
protected <S> S[] abstractCollectionToArray(S[] a)
protected boolean abstractCollectionRemove(T o)
protected boolean abstractCollectionContainsAll(java.util.Collection<?> c)
protected boolean abstractCollectionAddAll(java.util.Collection<? extends T> c)
protected boolean abstractCollectionRetainAll(java.util.Collection<?> c)
protected boolean abstractCollectionRemoveAll(java.util.Collection<?> c)
protected void abstractCollectionClear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||