|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.sj.util.AbstractCollection<T>
T
- public abstract class AbstractCollection<T>
A AbstactCollection as a basic implementation for lists, queues and more.
Field Summary | |
---|---|
protected de.cau.cs.kieler.sj.util.ContainerWithLink<T> |
cursor
Cursor used to iterate through a collection. |
protected de.cau.cs.kieler.sj.util.ContainerWithLink<T> |
lastContainer
The last container of the collection. |
protected de.cau.cs.kieler.sj.util.ContainerWithLink<T> |
leftSentinel
The left sentinel of the collection. |
protected int |
size
The size of the collection. |
Constructor Summary | |
---|---|
AbstractCollection()
Creates a empty AbstactCollection. |
Method Summary | |
---|---|
abstract void |
add(T o)
Adds a given element to the collection. |
void |
clear()
Deletes all elements of the collection. |
boolean |
contains(T o)
Tests if a given element is part of the collection. |
boolean |
isEmpty()
Tests if the collection is empty. |
Iterator<T> |
iterator()
Gives you an iterator of the collection. |
boolean |
remove(T o)
Removes a given element from the collection. |
int |
size()
Returns the size of the collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected de.cau.cs.kieler.sj.util.ContainerWithLink<T> leftSentinel
protected de.cau.cs.kieler.sj.util.ContainerWithLink<T> lastContainer
protected int size
protected de.cau.cs.kieler.sj.util.ContainerWithLink<T> cursor
Constructor Detail |
---|
public AbstractCollection()
Method Detail |
---|
public void clear()
public Iterator<T> iterator()
iterator
in interface Iterable<T>
public boolean isEmpty()
true
if empty else false
.public boolean contains(T o)
equals
is used.
o
- The element to test if it is part of the collection.
true
if the given element is part of the collection else
false
.public boolean remove(T o)
o
- The element that shoud be removed.
true
if the element was in the collection and could be removed.public abstract void add(T o)
o
- The element to add.public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |