|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> java.util.HashSet<E> java.util.LinkedHashSet<E> net.sourceforge.jaulp.collections.InsertionOrderSet<E>
public class InsertionOrderSet<E>
This class overwrites the put-method from the LinkedHashSet. That inserts the value to the right order it was inserted in the Map. Note that the difference in the LinkedHashMap is the order does not change if we put the same key with a new value. In this class the order changes when we put a new value with the same key.
LinkedHashSet
,
Serialized FormConstructor Summary | |
---|---|
InsertionOrderSet()
Constructs an empty insertion-ordered InsertionOrderSet instance with a default capacity (16) and load factor (0.75). |
|
InsertionOrderSet(java.util.Collection<? extends E> c)
Constructs a new insertion order hash set with the same elements as the specified collection. |
|
InsertionOrderSet(int initialCapacity)
Constructs an empty insertion-ordered InsertionOrderSet instance with the specified initial capacity and a default load factor (0.75). |
|
InsertionOrderSet(int initialCapacity,
float loadFactor)
Constructs an empty insertion-ordered InsertionOrderMap instance with the specified initial capacity and load factor. |
Method Summary | |
---|---|
boolean |
add(E o)
Adds the specified object to this set. |
Methods inherited from class java.util.HashSet |
---|
clear, clone, contains, isEmpty, iterator, remove, size |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public InsertionOrderSet()
public InsertionOrderSet(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed into this set.
java.lang.NullPointerException
- if the specified collection is null.public InsertionOrderSet(int initialCapacity)
initialCapacity
- the initial capacity.
java.lang.IllegalArgumentException
- if the initial capacity is negative.public InsertionOrderSet(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity.loadFactor
- the load factor.
java.lang.IllegalArgumentException
- if the initial capacity is negative or the load factor is
nonpositive.Method Detail |
---|
public boolean add(E o)
add
in interface java.util.Collection<E>
add
in interface java.util.Set<E>
add
in class java.util.HashSet<E>
o
- The object to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |