Package net.cscott.jutil
Class LinearSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.cscott.jutil.LinearSet<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,Set<E>
LinearSet is a simplistic light-weight
Set designed for use when the number of entries is
small. It is backed by a List.- Author:
- Felix S. Klock II <pnkfelix@mit.edu>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aLinearSet.LinearSet(int capacity) Creates aLinearSetwith given capacity.LinearSet(Collection<? extends E> c) Creates aLinearSet, filling it with the elements of the given collection.Creates aLinearSet, filling it with the elements ofset.LinearSet(ListFactory<E> lf) LinearSet(ListFactory<E> lf, int capacity) LinearSet(ListFactory<E> lf, Set<? extends E> set) -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
clear, contains, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
LinearSet
public LinearSet() -
LinearSet
public LinearSet(int capacity) -
LinearSet
-
LinearSet
-
LinearSet
-
LinearSet
-
LinearSet
-
-
Method Details
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceSet<E>- Overrides:
addin classAbstractCollection<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceSet<E>- Overrides:
addAllin classAbstractCollection<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceSet<E>- Overrides:
removein classAbstractCollection<E>
-
clone
-