|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
E
- The type of the elements contained in this
Container
.public interface Container<E>
A Container
is a Collection
of
elements. An element can be directly accessed, it is manipulated through its
Position
in the Container
. The
additional methods depend all on the Position
-based
behaviour of the elements of a Container
.
Method Summary | |
---|---|
E |
delete(Position<?> position)
Deletes the specified position and returns
the corresponding element. |
E |
element(Position<?> position)
This Container determines if
it contains the position and -- if it
is found -- the corresponding element is returned. |
boolean |
encloses(Position<?> position)
Tests if the specified position is
contained in this ch.bfh.algo.Container . |
Position<E> |
insert(E element)
Inserts the specified element into this
Container . |
Iterator<Position<E>> |
positionIterator()
An Iterator over all positions is created. |
E |
replace(Position<?> position,
E element)
Replaces the element at the specified position with
the specified element . |
void |
swap(Position<?> position0,
Position<?> position1)
|
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
---|
Position<E> insert(E element)
Inserts the specified element
into this
Container
.
element
- The element
to be inserted into this
Container
.
Position
of the inserted
element
.E element(Position<?> position) throws InvalidAccessorException
This Container
determines if
it contains the position
and -- if it
is found -- the corresponding element is returned.
position
- The position
from which the
element is to be returned.
position
InvalidAccessorException
- if the position
does not belong to this Container
E replace(Position<?> position, E element) throws InvalidAccessorException
Replaces the element at the specified position
with
the specified element
.
position
- The Position
where the replacement is
carried out.element
- The new element
at the specified
position
.
InvalidAccessorException
- if the position
does not belong to this Container
boolean encloses(Position<?> position)
Tests if the specified position
is
contained in this ch.bfh.algo.Container
.
position
- This Container
determines if
it contains the position
.
position
is contained in
this Container
, false otherwiseE delete(Position<?> position) throws InvalidAccessorException
Deletes the specified position
and returns
the corresponding element.
position
- The Position
to be deleted
position
being deleted
InvalidAccessorException
- if the position
does not belong to this Container
void swap(Position<?> position0, Position<?> position1) throws InvalidAccessorException
InvalidAccessorException
Iterator<Position<E>> positionIterator()
An Iterator
over all positions is created.
ch.bfh.algo.Container
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |