public class CompositeSet extends CompositeCollection implements java.util.Set
Changes made to this set will actually be made on the decorated set. Add operations require the use of a pluggable strategy. If no strategy is provided then add is unsupported.
Modifier and Type | Class and Description |
---|---|
static interface |
CompositeSet.SetMutator
Define callbacks for mutation operations.
|
CompositeCollection.CollectionMutator
Constructor and Description |
---|
CompositeSet()
Create an empty CompositeSet
|
CompositeSet(java.util.Set set)
Create a CompositeSet with just
set composited |
CompositeSet(java.util.Set[] sets)
Create a composite set with sets as the initial set of composited Sets
|
Modifier and Type | Method and Description |
---|---|
void |
addComposited(java.util.Collection c)
Add a Set to this composite
|
void |
addComposited(java.util.Collection[] comps)
Add an array of sets to this composite
|
void |
addComposited(java.util.Collection c,
java.util.Collection d)
Add two sets to this composite
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
remove(java.lang.Object obj)
If a
CollectionMutator is defined for this CompositeSet then this
method will be called anyway. |
void |
setMutator(CompositeCollection.CollectionMutator mutator)
This can receive either a
CompositeCollection.CollectionMutator
or a CompositeSet.SetMutator . |
add, addAll, clear, contains, containsAll, getCollections, isEmpty, iterator, removeAll, removeComposited, retainAll, size, toArray, toArray, toCollection
getClass, notify, notifyAll, toString, wait, wait, wait
public CompositeSet()
public CompositeSet(java.util.Set set)
set
compositedset
- The initial set in the compositepublic CompositeSet(java.util.Set[] sets)
public void addComposited(java.util.Collection c)
addComposited
in class CompositeCollection
c
- Must implement Setjava.lang.IllegalArgumentException
- if c does not implement java.util.Set
or if a SetMutator is set, but fails to resolve a collisionjava.lang.UnsupportedOperationException
- if there is no SetMutator set, or
a CollectionMutator is set instead of a SetMutatorCompositeCollection.CollectionMutator
,
CompositeSet.SetMutator
public void addComposited(java.util.Collection c, java.util.Collection d)
addComposited
in class CompositeCollection
c
- the first collection to addd
- the second collection to addjava.lang.IllegalArgumentException
- if c or d does not implement java.util.Setpublic void addComposited(java.util.Collection[] comps)
addComposited
in class CompositeCollection
comps
- java.lang.IllegalArgumentException
- if any of the collections in comps do not implement Setpublic void setMutator(CompositeCollection.CollectionMutator mutator)
CompositeCollection.CollectionMutator
or a CompositeSet.SetMutator
. If a
CompositeCollection.CollectionMutator
is used than conflicts when adding
composited sets will throw IllegalArgumentException
setMutator
in class CompositeCollection
mutator
- the mutator to usepublic boolean remove(java.lang.Object obj)
CollectionMutator
is defined for this CompositeSet then this
method will be called anyway.remove
in interface java.util.Collection
remove
in interface java.util.Set
remove
in class CompositeCollection
obj
- Object to be removedpublic boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection
equals
in interface java.util.Set
equals
in class java.lang.Object
Set.equals(java.lang.Object)
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.Set
hashCode
in class java.lang.Object
Set.hashCode()
Copyright © 2010 - 2020 Adobe. All Rights Reserved