dh.java.util.collection
Class UnsafeListSet<E>
java.lang.Object
dh.java.util.collection.ListSet<E>
dh.java.util.collection.UnsafeListSet<E>
- All Implemented Interfaces:
- EquivalenceClass<E>, Iterable<E>, Collection<E>, Set<E>
public class UnsafeListSet<E>
- extends ListSet<E>
- implements EquivalenceClass<E>
Method Summary |
E |
getRepresentative()
|
void |
unsafeAdd(E o)
Will add the given object to this set without checking if its is already
contained. |
void |
unsafeAddAll(Collection<? extends E> c)
Will add the given objects to this set without checking if they are
already contained. |
Methods inherited from class dh.java.util.collection.ListSet |
add, addAll, clear, contains, containsAll, isEmpty, isModifiable, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
UnsafeListSet
public UnsafeListSet()
UnsafeListSet
public UnsafeListSet(Collection<? extends E> collection)
UnsafeListSet
public UnsafeListSet(Collection<? extends E> collection,
boolean modifiable)
UnsafeListSet
public UnsafeListSet(E element)
getRepresentative
public E getRepresentative()
- Specified by:
getRepresentative
in interface EquivalenceClass<E>
unsafeAdd
public void unsafeAdd(E o)
- Will add the given object to this set without checking if its is already
contained.
So this Method may break the general contract of Set. It should be used
only for performance reasons. If it may be possible that the given object
is already contained in this set, this method should be avoided for the
benefit of
ListSet.add(E)
.
- Parameters:
o
- the Object to add
- Throws:
UnsupportedOperationException
- if this set is not modifiable- See Also:
ListSet.add(E)
unsafeAddAll
public void unsafeAddAll(Collection<? extends E> c)
- Will add the given objects to this set without checking if they are
already contained.
So this Method may break the general contract of Set. It should be used
only for performance reasons. If it may be possible that only one of
given objects is already contained in this set, this method should be
avoided for the benefit of
ListSet.addAll(java.util.Collection extends E>)
.
- Parameters:
c
- the Objects to add
- Throws:
UnsupportedOperationException
- if this set is not modifiable- See Also:
ListSet.addAll(java.util.Collection extends E>)
Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.