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>
public class ListableHashSet<E>
- extends LinkedHashSet<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 throws JiBXException if the item is already in the set
(suitable for use as a JiBX add-method)
- Since:
- 1.0.64
- See Also:
- Serialized Form
|
Method Summary |
void |
addUnique(E item)
Add an item to a set while verifying that the item is not already in the set. |
| Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ListableHashSet
public ListableHashSet()
ListableHashSet
public ListableHashSet(Collection<? extends E> c)
ListableHashSet
public ListableHashSet(int initialCapacity)
ListableHashSet
public ListableHashSet(int initialCapacity,
float loadFactor)
addUnique
public void addUnique(E item)
throws JiBXException
- Add an item to a set while verifying that the item is not already in the set.
- Throws:
JiBXException - if item is already in the set