Top Description Fields Constructors Methods
org.apache.commons.collections4.set

public abstract Class AbstractSetDecorator<E>

extends AbstractCollectionDecorator<E>
implements Set<E>
Class Inheritance
All Implemented Interfaces
java.util.Set, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
org.apache.commons.collections4.set.AbstractSortedSetDecorator, org.apache.commons.collections4.map.AbstractInputCheckedMapDecorator.EntrySet, org.apache.commons.collections4.map.UnmodifiableEntrySet, org.apache.commons.collections4.set.AbstractSerializableSetDecorator
Type Parameters
<E>
the type of the elements in this set
Imports
java.util.Set, org.apache.commons.collections4.collection.AbstractCollectionDecorator

Decorates another Set to provide additional behaviour.

Methods are forwarded directly to the decorated set.

Since
3.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
AbstractSetDecorator()

Constructor only used in deserialization, do not use otherwise.

protected
AbstractSetDecorator(final Set<E>
the set to decorate, must not be null
set
)

Constructor that wraps (not copies).

Method Summary

Modifier and TypeMethod and Description
protected Set<E>

Returns:

the decorated set
decorated
()

Overrides org.apache.commons.collections4.collection.AbstractCollectionDecorator.decorated.

Gets the set being decorated.
public boolean
equals(final Object
object to be compared for equality with this set
object
)

Overrides java.lang.Object.equals.

Implements java.util.Set.equals, java.util.Collection.equals.

Compares the specified object with this set for equality.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this set.
Inherited from org.apache.commons.collections4.collection.AbstractCollectionDecorator:
addaddAllclearcontainscontainsAllisEmptyiteratorremoveremoveAllremoveIfretainAllsetCollectionsizetoArraytoArraytoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.collections4.collection.AbstractCollectionDecorator.serialVersionUID.

Serialization version

Constructor Detail

AbstractSetDecoratorback to summary
protected AbstractSetDecorator()

Constructor only used in deserialization, do not use otherwise.

Since
3.1
AbstractSetDecoratorback to summary
protected AbstractSetDecorator(final Set<E> set)

Constructor that wraps (not copies).

Parameters
set:Set<E>

the set to decorate, must not be null

Exceptions
NullPointerException:
if set is null

Method Detail

decoratedback to summary
protected Set<E> decorated()

Overrides org.apache.commons.collections4.collection.AbstractCollectionDecorator.decorated.

Gets the set being decorated.

Returns:Set<E>

the decorated set

Annotations
@Override
equalsback to summary
public boolean equals(final Object object)

Overrides java.lang.Object.equals.

Implements java.util.Set.equals, java.util.Collection.equals.

Doc from java.util.Set.equals.

Compares the specified object with this set for equality. Returns true if the specified object is also a set, the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set). This definition ensures that the equals method works properly across different implementations of the set interface.

Parameters
object:Object

object to be compared for equality with this set

Returns:boolean

true if the specified object is equal to this set

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.Set.hashCode.

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 null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

Returns:int

the hash code value for this set

Annotations
@Override