Package org.plumelib.util
Class ArraysPlume.Partitioning<T extends @NonNull Object>
- Type Parameters:
T- the type of the elements of the sets
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<ArrayList<T>>,Collection<ArrayList<T>>,List<ArrayList<T>>,RandomAccess
- Enclosing class:
- ArraysPlume
A partitioning is a set of sets. It adds a few methods to
ArrayList<ArrayList<T>>.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final longUnique identifier for serialization.Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor.Partitioning(ArraysPlume.Partitioning<T> other) Copy constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) ArraysPlume.Partitioning<T>Returns a new partitioning just like this one, but with elt added to the ith part.(package private) booleanisPartitioningFor(List<T> elts) True if this is a partitioning forelts.The set that has been partitioned.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Field Details
-
serialVersionUID
static final long serialVersionUIDUnique identifier for serialization. If you add or remove fields, change this number.- See Also:
-
-
Constructor Details
-
Partitioning
Partitioning()Empty constructor. -
Partitioning
Partitioning(ArraysPlume.Partitioning<T> other) Copy constructor.- Parameters:
other- the Partitioning to make a copy of
-
-
Method Details
-
partitionedSet
The set that has been partitioned. That is, all the elements that have been added to this. Equivalently, the union of all the partitions.- Returns:
- all the elements in any part of the Partitioning
-
isPartitioningFor
True if this is a partitioning forelts.- Parameters:
elts- the elements that might be partitioned by this- Returns:
- true if this is a partitioning for
elts
-
addToPart
ArraysPlume.Partitioning<T> addToPart(@org.checkerframework.checker.index.qual.NonNegative int i, T elt) Returns a new partitioning just like this one, but with elt added to the ith part.- Parameters:
i- the index of an existing part, or the current size (to create a new part)elt- the element to add- Returns:
- a new partitioning just like this one, but with elt added to the ith part
-