Package org.dellroad.stuff.jibx
Class ListableHashSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
java.util.LinkedHashSet<E>
org.dellroad.stuff.jibx.ListableHashSet<E>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<E>
,Collection<E>
,Set<E>
Set
implementation with these properties which make it suitable for use with JiBX:
- Iteration order reflects addition order (this property is inherited from
LinkedHashSet
) - An
addUnique(E)
method that throwsJiBXException
if the item is already in the set (suitable for use as a JiBXadd-method
)
- Since:
- 1.0.64
- See Also:
-
Constructor Summary
ConstructorDescriptionListableHashSet
(int initialCapacity) ListableHashSet
(int initialCapacity, float loadFactor) ListableHashSet
(Collection<? extends E> c) -
Method Summary
Methods inherited from class java.util.LinkedHashSet
spliterator
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, toArray, toArray
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
ListableHashSet
public ListableHashSet() -
ListableHashSet
-
ListableHashSet
public ListableHashSet(int initialCapacity) -
ListableHashSet
public ListableHashSet(int initialCapacity, float loadFactor)
-
-
Method Details
-
addUnique
Add an item to a set while verifying that the item is not already in the set.- Parameters:
item
- item to add- Throws:
JiBXException
- if item is already in the set
-