Package org.jgrapht.util
Class ArrayUnenforcedSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<E>
-
- org.jgrapht.util.ArrayUnenforcedSet<E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,java.util.RandomAccess
,java.util.Set<E>
public class ArrayUnenforcedSet<E> extends java.util.ArrayList<E> implements java.util.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.
- Author:
- John V. Sichi
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayUnenforcedSet()
ArrayUnenforcedSet(int n)
ArrayUnenforcedSet(java.util.Collection<? extends E> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
ArrayUnenforcedSet
public ArrayUnenforcedSet()
-
ArrayUnenforcedSet
public ArrayUnenforcedSet(java.util.Collection<? extends E> c)
-
ArrayUnenforcedSet
public ArrayUnenforcedSet(int n)
-
-