Class ArrayUnenforcedSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.jgrapht.util.ArrayUnenforcedSet<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>, Set<E>
Helper for efficiently representing small sets whose elements are known to be unique by
construction, implying we don't need to enforce the uniqueness property in the data structure
itself. Use with caution.
Note that for equals/hashCode, the class implements the Set behavior (unordered), not the list behavior (ordered); the fact that it subclasses ArrayList should be considered an implementation detail.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classMultiple inheritance helper. -
Field Summary
FieldsFields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new empty setArrayUnenforcedSet(int n) Constructs an empty set with the specified initial capacity.ArrayUnenforcedSet(Collection<? extends E> c) Constructs a set containing the elements of the specified collection. -
Method Summary
Methods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
ArrayUnenforcedSet
public ArrayUnenforcedSet()Constructs a new empty set -
ArrayUnenforcedSet
Constructs a set containing the elements of the specified collection.- Parameters:
c- the collection whose elements are to be placed into this set- Throws:
NullPointerException- if the specified collection is null
-
ArrayUnenforcedSet
public ArrayUnenforcedSet(int n) Constructs an empty set with the specified initial capacity.- Parameters:
n- the initial capacity of the set- Throws:
IllegalArgumentException- if the specified initial capacity is negative
-
-
Method Details
-
equals
-
hashCode
-