Class LinkedSet<E>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    public class LinkedSet<E>
    extends java.util.AbstractSet<E>
    implements java.util.Set<E>, java.lang.Cloneable, java.io.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

      Constructors 
      Constructor Description
      LinkedSet()  
      LinkedSet​(java.util.Collection<E> pCollection)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(E pValue)  
      boolean addAll​(java.util.Collection<? extends E> pCollection)  
      java.util.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.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, spliterator, toArray, toArray
    • Constructor Detail

      • LinkedSet

        public LinkedSet()
      • LinkedSet

        public LinkedSet​(java.util.Collection<E> pCollection)
    • Method Detail

      • addAll

        public boolean addAll​(java.util.Collection<? extends E> pCollection)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.Set<E>
        Overrides:
        addAll in class java.util.AbstractCollection<E>
      • add

        public boolean add​(E pValue)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.Set<E>
        Overrides:
        add in class java.util.AbstractCollection<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.Set<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • iterator

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