com.kuka.graph.util
Class ArraySetUnenforced<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<T>
com.kuka.graph.util.ArraySetUnenforced<T>
- Type Parameters:
T - the type of the elements in the set
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, Set<T>
public class ArraySetUnenforced<T>
- extends ArrayList<T>
- implements Set<T>
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:
- 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 |
ArraySetUnenforced
public ArraySetUnenforced()
- Constructs an empty set with an initial capacity of ten.
ArraySetUnenforced
public ArraySetUnenforced(Collection<? extends T> c)
- 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
ArraySetUnenforced
public ArraySetUnenforced(int initialCapacity)
- Constructs an empty set with the specified initial capacity.
- Parameters:
initialCapacity - the initial capacity of the set
- Throws:
IllegalArgumentException - if the specified initial capacity is negative
equals
public boolean equals(Object o)
- Specified by:
equals in interface Collection<T>- Specified by:
equals in interface List<T>- Specified by:
equals in interface Set<T>- Overrides:
equals in class AbstractList<T>
hashCode
public int hashCode()
- Specified by:
hashCode in interface Collection<T>- Specified by:
hashCode in interface List<T>- Specified by:
hashCode in interface Set<T>- Overrides:
hashCode in class AbstractList<T>
Copyright © 2019. All rights reserved.