Interface CompositeSet.SetMutator<E>
-
- All Superinterfaces:
Serializable
- Enclosing class:
- CompositeSet<E>
public static interface CompositeSet.SetMutator<E> extends Serializable
Define callbacks for mutation operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(CompositeSet<E> composite, List<Set<E>> sets, E obj)Called when an object is to be added to the composite.booleanaddAll(CompositeSet<E> composite, List<Set<E>> sets, Collection<? extends E> coll)Called when a collection is to be added to the composite.voidresolveCollision(CompositeSet<E> comp, Set<E> existing, Set<E> added, Collection<E> intersects)Called when a Set is added to the CompositeSet and there is a collision between existing and added sets.
-
-
-
Method Detail
-
add
boolean add(CompositeSet<E> composite, List<Set<E>> sets, E obj)
Called when an object is to be added to the composite.- Parameters:
composite- the CompositeSet being changedsets- all of the Set instances in this CompositeSetobj- the object being added- Returns:
- true if the collection is changed
- Throws:
UnsupportedOperationException- if add is unsupportedClassCastException- if the object cannot be added due to its typeNullPointerException- if the object cannot be added because its nullIllegalArgumentException- if the object cannot be added
-
addAll
boolean addAll(CompositeSet<E> composite, List<Set<E>> sets, Collection<? extends E> coll)
Called when a collection is to be added to the composite.- Parameters:
composite- the CompositeSet being changedsets- all of the Set instances in this CompositeSetcoll- the collection being added- Returns:
- true if the collection is changed
- Throws:
UnsupportedOperationException- if add is unsupportedClassCastException- if the object cannot be added due to its typeNullPointerException- if the object cannot be added because its nullIllegalArgumentException- if the object cannot be added
-
resolveCollision
void resolveCollision(CompositeSet<E> comp, Set<E> existing, Set<E> added, Collection<E> intersects)
Called when a Set is added to the CompositeSet and there is a collision between existing and added sets.If
addedandexistingstill have any intersects after this method returns an IllegalArgumentException will be thrown.- Parameters:
comp- the CompositeSet being modifiedexisting- the Set already existing in the compositeadded- the Set being added to the compositeintersects- the intersection of the existing and added sets
-
-