Package de.alpharogroup.collections.set
Class IndexableSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<E>
-
- java.util.LinkedHashSet<E>
-
- de.alpharogroup.collections.set.InsertionOrderSet<E>
-
- de.alpharogroup.collections.set.IndexableSet<E>
-
- Type Parameters:
E- the element type
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>
public class IndexableSet<E> extends InsertionOrderSet<E>
The classIndexableSet- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IndexableSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Eget(int index)Gets the element of the given index
Note: use with cautionintgetIndex(E element)Gets the index of the given element-
Methods inherited from class de.alpharogroup.collections.set.InsertionOrderSet
add, setOf
-
Methods inherited from class java.util.HashSet
clear, clone, contains, isEmpty, iterator, remove, size
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
get
public E get(int index)
Gets the element of the given index
Note: use with caution- Parameters:
index- the index- Returns:
- the element of the given index or throws an
IndexOutOfBoundsException - Throws:
java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
getIndex
public int getIndex(E element)
Gets the index of the given element- Parameters:
element- the element- Returns:
- the index of the element or -1 if its not exists
-
-