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:
- Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, Set<E>
public class ArrayUnenforcedSet<E>
- extends ArrayList<E>
- implements 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
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ArrayUnenforcedSet
public ArrayUnenforcedSet()
ArrayUnenforcedSet
public ArrayUnenforcedSet(Collection<? extends E> c)
ArrayUnenforcedSet
public ArrayUnenforcedSet(int n)
equals
public boolean equals(Object o)
- Specified by:
equals
in interface Collection<E>
- Specified by:
equals
in interface List<E>
- Specified by:
equals
in interface Set<E>
- Overrides:
equals
in class AbstractList<E>
hashCode
public int hashCode()
- Specified by:
hashCode
in interface Collection<E>
- Specified by:
hashCode
in interface List<E>
- Specified by:
hashCode
in interface Set<E>
- Overrides:
hashCode
in class AbstractList<E>
Copyright © 2013. All rights reserved.