Warning
The methods of ForwardingSet forward indiscriminately to the
methods of the delegate. For example, overriding add alone will not change the
behavior of addAll, which can lead to unexpected behavior. In this case, you should
override addAll as well, either providing your own implementation, or delegating to the
provided standardAddAll method.
default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations
invoke methods, they invoke methods on the ForwardingSet.
The standard methods are not guaranteed to be thread-safe, even when all of the
methods that they depend on are thread-safe.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract Set | delegate()
Implements abstract com. |
| public boolean | equals(Object
object to be compared for equality with this set object)Overrides java. Implements java. |
| public int | hashCode()
Overrides java. Implements java. |
| protected boolean | |
| protected int | |
| protected boolean | standardRemoveAll(Collection<?> collection)
Overrides com. removeAll in terms of iterator and remove.
|
| ForwardingSet | back to summary |
|---|---|
| protected ForwardingSet() Constructor for use by subclasses. | |
| delegate | back to summary |
|---|---|
| protected abstract Set Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Implements java. Doc from java. Compares the specified object with this set for equality. Returns
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this set. The hash code of a set is
defined to be the sum of the hash codes of the elements in the set,
where the hash code of a
| |
| standardEquals | back to summary |
|---|---|
| protected boolean standardEquals(Object object) A sensible definition of
| |
| standardHashCode | back to summary |
|---|---|
| protected int standardHashCode() A sensible definition of
| |
| standardRemoveAll | back to summary |
|---|---|
| protected boolean standardRemoveAll(Collection<?> collection) Overrides com. A sensible definition of
| |