com.twelvemonkeys.util
Class LinkedSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by com.twelvemonkeys.util.LinkedSet<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>

public class LinkedSet<E>
extends AbstractSet<E>
implements Set<E>, Cloneable, Serializable

Generic map and linked list implementation of the Set interface, with predictable iteration order.

Resembles LinkedHashSet from JDK 1.4+, but is backed by a generic LinkedMap, rather than implementing a particular algoritm.

Version:
$Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/LinkedSet.java#1 $
Author:
Harald Kuhr
See Also:
LinkedMap, Serialized Form

Constructor Summary
LinkedSet()
           
LinkedSet(Collection<E> pCollection)
           
 
Method Summary
 boolean add(E pValue)
           
 boolean addAll(Collection<? extends E> pCollection)
           
 Iterator<E> iterator()
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

LinkedSet

public LinkedSet()

LinkedSet

public LinkedSet(Collection<E> pCollection)
Method Detail

addAll

public boolean addAll(Collection<? extends E> pCollection)
Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface Set<E>
Overrides:
addAll in class AbstractCollection<E>

add

public boolean add(E pValue)
Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>
Overrides:
add in class AbstractCollection<E>

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>
Specified by:
size in class AbstractCollection<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>
Specified by:
iterator in class AbstractCollection<E>


Copyright © 2014. All Rights Reserved.