Package org.biojava.utils
Class SmallSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet
org.biojava.utils.SmallSet
- All Implemented Interfaces:
Iterable,Collection,Set
Lightweight implementation of Set which uses little memory to store a small
number of items, at the expense of scalability. Not recomended for more than
20-30 items.
This implementation has the useful property that the iteration order is the same as the order in which the items are added.
- Author:
- Matthew Pocock
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
SmallSet
public SmallSet() -
SmallSet
-
SmallSet
-
-
Method Details
-
contains
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceSet- Overrides:
containsin classAbstractCollection
-
size
- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceSet- Specified by:
sizein classAbstractCollection
-
add
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceSet- Overrides:
addin classAbstractCollection
-
iterator
- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin interfaceSet- Specified by:
iteratorin classAbstractCollection
-