|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.OrderedSet
public class OrderedSet
Implements a Set that keeps the order of its elements according to when they were added. Additionally it implements the List interface. So instances of this class can either be used as Set or as List.
| Constructor Summary | |
|---|---|
OrderedSet()
Initialize the new instance with default values. |
|
OrderedSet(int initialCapacity)
Initialize the new set with an initial capacity. |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
Inserts the specified element at the specified position in this list |
boolean |
add(java.lang.Object obj)
|
boolean |
addAll(java.util.Collection coll)
|
boolean |
addAll(int index,
java.util.Collection c)
Inserts all of the elements in the specified collection into this list at the specified position if they are not yet in this list. |
void |
clear()
|
boolean |
contains(java.lang.Object obj)
|
boolean |
containsAll(java.util.Collection coll)
|
java.lang.Object |
get(int index)
Returns the element at the specified position in this list. |
int |
indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
int |
lastIndexOf(java.lang.Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. |
java.util.ListIterator |
listIterator()
Returns a list iterator of the elements in this list (in proper sequence). |
java.util.ListIterator |
listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. |
java.lang.Object |
remove(int index)
Returns the object at the specified index |
boolean |
remove(java.lang.Object obj)
|
boolean |
removeAll(java.util.Collection coll)
|
boolean |
retainAll(java.util.Collection coll)
|
java.lang.Object |
set(int index,
java.lang.Object element)
Sets the given element at the specified index if the element is not yet already in the collection! |
int |
size()
|
java.util.List |
subList(int fromIndex,
int toIndex)
Returns a sub list containing the elements in the range of the defined indices. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] array)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
equals, hashCode |
| Methods inherited from interface java.util.List |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public OrderedSet()
public OrderedSet(int initialCapacity)
| Method Detail |
|---|
public boolean add(java.lang.Object obj)
add in interface java.util.Collectionadd in interface java.util.Listadd in interface java.util.SetCollection.add(java.lang.Object)public boolean addAll(java.util.Collection coll)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in interface java.util.SetCollection.addAll(java.util.Collection)public void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in interface java.util.SetCollection.clear()public boolean contains(java.lang.Object obj)
contains in interface java.util.Collectioncontains in interface java.util.Listcontains in interface java.util.SetCollection.contains(java.lang.Object)public boolean containsAll(java.util.Collection coll)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.ListcontainsAll in interface java.util.SetCollection.containsAll(java.util.Collection)public boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in interface java.util.SetCollection.isEmpty()public java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in interface java.util.SetCollection.iterator()public boolean remove(java.lang.Object obj)
remove in interface java.util.Collectionremove in interface java.util.Listremove in interface java.util.SetCollection.remove(java.lang.Object)public boolean removeAll(java.util.Collection coll)
removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in interface java.util.SetCollection.removeAll(java.util.Collection)public boolean retainAll(java.util.Collection coll)
retainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in interface java.util.SetCollection.retainAll(java.util.Collection)public int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in interface java.util.SetCollection.size()public java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in interface java.util.SetCollection.toArray()public java.lang.Object[] toArray(java.lang.Object[] array)
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in interface java.util.SetCollection.toArray(java.lang.Object[])
public void add(int index,
java.lang.Object element)
add in interface java.util.List
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.Listpublic java.lang.Object get(int index)
get in interface java.util.Listpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.Listpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.Listpublic java.util.ListIterator listIterator()
listIterator in interface java.util.Listpublic java.util.ListIterator listIterator(int index)
listIterator in interface java.util.Listpublic java.lang.Object remove(int index)
remove in interface java.util.List
public java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.List
public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.List
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||