|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjgroup.util.OrderedList
public class OrderedList
The OrderedList
class represents an ordered collection
of objects. The order of elements is based on their keys,
represented as integer values.
BindingList
Field Summary | |
---|---|
int |
key
The identifier of this element |
protected OrderedList |
next
Reference to the next element |
Constructor Summary | |
---|---|
protected |
OrderedList()
Creates an empty list. |
Method Summary | |
---|---|
int |
count()
Count the number of elements in the list |
OrderedList |
getFirst()
Returns the first element of the OrderedList |
OrderedList |
getNext()
Returns the next element in the OrderedList. |
boolean |
insert(OrderedList object)
Inserts the specified element in the OrderedList. |
boolean |
isEmpty()
Returns true if this OrderedList contains no elements. |
OrderedList |
lookup(int key)
Returns the first occurrence in this OrderedList of a element with the specified key, or null if the element is not found. |
OrderedList |
remove(int key)
Removes the first occurrence of an element with the specified key in this OrderedList. |
void |
removeAll(int key)
|
OrderedList |
removeFirst()
Removes and returns the first element of the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int key
protected OrderedList next
Constructor Detail |
---|
protected OrderedList()
Method Detail |
---|
public boolean insert(OrderedList object)
object
- The element to be inserted in this OrderedList.
public OrderedList remove(int key)
null
.
key
- the key to search for.public void removeAll(int key)
key
- the key to search for.public OrderedList removeFirst()
null
will be returned.
public OrderedList lookup(int key)
null
if the element is not found.
key
- the key to search for.public OrderedList getNext()
public OrderedList getFirst()
public boolean isEmpty()
public int count()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |