|
Jadex 0.96-beta1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
java.util.LinkedList
jadex.util.collection.SortedList
public class SortedList
A sorted list allowing duplicates of elements (unlike java.util.TreeSet). The list is kept sorted, while elements are being added.
Constructor Summary | |
---|---|
SortedList()
Constructs an empty list with ascending order. |
|
SortedList(boolean ascending)
Constructs an empty list with given order. |
|
SortedList(Comparator comp,
boolean ascending)
Constructs an empty list with given order. |
Method Summary | |
---|---|
void |
add(int index,
Object element)
Inserts the specified element at the specified position in this list. |
boolean |
add(Object o)
Appends the specified element to the end of this list. |
boolean |
addAll(Collection c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator. |
boolean |
addAll(int index,
Collection c)
Inserts all of the elements in the specified collection into this list, starting at the specified position. |
void |
addFirst(Object o)
Inserts the given element at the beginning of this list. |
void |
addLast(Object o)
Appends the given element to the end of this list. |
int |
insertElement(int index,
Object obj)
Insert an element into the list. |
Methods inherited from class java.util.LinkedList |
---|
clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public SortedList()
public SortedList(boolean ascending)
ascending
- True, if the list shoudl sort ascending.public SortedList(Comparator comp, boolean ascending)
comp
- A comparator to use for comparing elements.ascending
- True, if the list shoudl sort ascending.Method Detail |
---|
public void addFirst(Object o)
addFirst
in class LinkedList
o
- the element to be inserted at the beginning of this list.public void addLast(Object o)
addLast
in class LinkedList
o
- the element to be inserted at the end of this list.public boolean add(Object o)
add
in interface Collection
add
in interface List
add
in class LinkedList
o
- element to be appended to this list.
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
addAll
in class LinkedList
c
- the elements to be inserted into this list.
NullPointerException
- if the specified collection is null.public boolean addAll(int index, Collection c)
addAll
in interface List
addAll
in class LinkedList
index
- index at which to insert first element
from the specified collection.c
- elements to be inserted into this list.
IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index > size()).
NullPointerException
- if the specified collection is null.public void add(int index, Object element)
add
in interface List
add
in class LinkedList
index
- index at which the specified element is to be inserted.element
- element to be inserted.
IndexOutOfBoundsException
- if the specified index is out of
range (index < 0 || index > size()).public int insertElement(int index, Object obj)
index
- The index where to start insertion.obj
- The element to insert.
|
Jadex 0.96-beta1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.