javaDungAF
Class SetComparison

Object
  extended by SetComparison

public class SetComparison
extends Object

Provides two naive methods for removing non-maximal and non-minimal members of collections-of-collections.

The methods simply use containsAll(Collection<?>) to compare collections, so their effects depend on the types of the members of the collections. The methods would have no effect on, for instance, a collection of sets-of-arrays { {[obj0, obj1]}, {[obj0, obj1], [obj1, obj0]} }, if the two references to '[obj0, obj1]' were not to one and the same object.


Constructor Summary
SetComparison()
           
 
Method Summary
static
<T extends Collection>
boolean
removeNonMaximalMembersOf(Collection<T> collColl)
          Removes collColl's non-maximal members, simply using containsAll(Collection<?>) to compare the collections.
static
<T extends Collection>
boolean
removeNonMinimalMembersOf(Collection<T> collColl)
          Removes collColl's non-minimal members, simply using containsAll(Collection<?>) to compare the collections.
private static
<T extends Collection>
boolean
removeNonMinimalOrNonMaximalHelper(Collection<T> collColl, boolean removeNonMinimal)
          Removes collColl's non-minimal/non-maximal members, simply using containsAll(Collection<?>) to compare the collections.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetComparison

public SetComparison()
Method Detail

removeNonMinimalMembersOf

public static <T extends Collection> boolean removeNonMinimalMembersOf(Collection<T> collColl)
Removes collColl's non-minimal members, simply using containsAll(Collection<?>) to compare the collections.

Parameters:
collColl - a Collection of Collections.
Returns:
true if collColl changed as a result of the call.

removeNonMaximalMembersOf

public static <T extends Collection> boolean removeNonMaximalMembersOf(Collection<T> collColl)
Removes collColl's non-maximal members, simply using containsAll(Collection<?>) to compare the collections.

Parameters:
collColl - a Collection of Collections.
Returns:
true if collColl changed as a result of the call.

removeNonMinimalOrNonMaximalHelper

private static <T extends Collection> boolean removeNonMinimalOrNonMaximalHelper(Collection<T> collColl,
                                                                                 boolean removeNonMinimal)
Removes collColl's non-minimal/non-maximal members, simply using containsAll(Collection<?>) to compare the collections.

Parameters:
collColl - a Collection of Collections.
removeNonMinimal - whether it is the non-minimal or non-maximal members of collColl that are to be removed.
Returns:
true if collColl changed as a result of the call.