Class OrderedSet
- java.lang.Object
 - 
- java.util.AbstractCollection<E>
 - 
- java.util.AbstractSet
 - 
- com.sun.identity.shared.datastruct.OrderedSet
 
 
 
 
- 
- All Implemented Interfaces:
 Serializable,Iterable,Collection,Set
public class OrderedSet extends AbstractSet implements Set, Serializable
This class extends from AbstractSet. It uses List for storing data so that data is stored in the order input. It overwrites add, iterator and size methods. All other methods it needs are in the base class.- See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description OrderedSet() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object o)Adds the specified element to this set if it is not already present (optional operation).booleanaddAll(Set s)Adds all entries in the given Set to this Set.Objectget(int index)Returns the object of an given index.Iteratoriterator()Returns an iterator over the elements in this set.voidremoveAll(Integer[] array)Deletes entries of a given array of indices.voidset(int index, Object value)Set value to the list.intsize()Returns the number of elements in this set (its cardinality).- 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll 
- 
Methods inherited from class java.util.AbstractCollection
addAll, 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 
 - 
 
 - 
 
- 
- 
Field Detail
- 
list
protected List list
 
 - 
 
- 
Method Detail
- 
add
public boolean add(Object o)
Adds the specified element to this set if it is not already present (optional operation).- Specified by:
 addin interfaceCollection- Specified by:
 addin interfaceSet- Overrides:
 addin classAbstractCollection- Parameters:
 o- Object to be added
 
- 
iterator
public Iterator iterator()
Returns an iterator over the elements in this set.- Specified by:
 iteratorin interfaceCollection- Specified by:
 iteratorin interfaceIterable- Specified by:
 iteratorin interfaceSet- Specified by:
 iteratorin classAbstractCollection- Returns:
 - an iterator over the elements in this set.
 
 
- 
size
public int size()
Returns the number of elements in this set (its cardinality).- Specified by:
 sizein interfaceCollection- Specified by:
 sizein interfaceSet- Specified by:
 sizein classAbstractCollection- Returns:
 - the number of elements in this set
 
 
- 
addAll
public boolean addAll(Set s)
Adds all entries in the given Set to this Set. 
- 
removeAll
public void removeAll(Integer[] array)
Deletes entries of a given array of indices.- Parameters:
 array- Array of indices.
 
- 
get
public Object get(int index)
Returns the object of an given index.- Parameters:
 index- Index of which object resides
 
- 
set
public void set(int index, Object value)Set value to the list.- Parameters:
 index- Index of object.value- Value of object.
 
 - 
 
 -