jjdh API

dh.java.util.collection
Class UnsafeListSet<E>

java.lang.Object
  extended by dh.java.util.collection.ListSet<E>
      extended by 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>


Field Summary
 
Fields inherited from class dh.java.util.collection.ListSet
list, modifiable
 
Constructor Summary
UnsafeListSet()
           
UnsafeListSet(Collection<? extends E> collection)
           
UnsafeListSet(Collection<? extends E> collection, boolean modifiable)
           
UnsafeListSet(E element)
           
 
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

UnsafeListSet

public UnsafeListSet()

UnsafeListSet

public UnsafeListSet(Collection<? extends E> collection)

UnsafeListSet

public UnsafeListSet(Collection<? extends E> collection,
                     boolean modifiable)

UnsafeListSet

public UnsafeListSet(E element)
Method Detail

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).

Parameters:
c - the Objects to add
Throws:
UnsupportedOperationException - if this set is not modifiable
See Also:
ListSet.addAll(java.util.Collection)

jjdh API

Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.