|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nz.ac.waikato.jdsl.core.ref.AbstractPositionalContainer
public abstract class AbstractPositionalContainer
An abstract positional container that others may extend if they do not wish to deal with some of the more mundane aspects of positional containers and/or if they wish to avoid implementing themselves some of the methods of container that aren't terribly pertinent to a PositionalContainer. Feel free to override any of these methods in subclasses, but be certain that they work according to the API in nz.ac.waikato.jdsl.core.api. Also handles isEmpty() from InspectableContainer.
PositionalContainer
Constructor Summary | |
---|---|
AbstractPositionalContainer()
|
Method Summary | |
---|---|
boolean |
isEmpty()
Checks if this container is empty. |
void |
swapElements(Position a,
Position b)
Works on top of PositionalContainer method replaceElement(Position, Object) and InspectableContainer method contains(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectablePositionalContainer |
---|
positions |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.Container |
---|
newContainer, replaceElement |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableContainer |
---|
contains, elements, size |
Constructor Detail |
---|
public AbstractPositionalContainer()
Method Detail |
---|
public void swapElements(Position a, Position b) throws InvalidAccessorException
swapElements
in interface PositionalContainer
a
- First Position to swapb
- Second Position to swap
InvalidAccessorException
- if either of a
and b
is null or does not belong to this positional
containerpublic boolean isEmpty()
isEmpty
in interface InspectableContainer
true
if and only if the container is empty (holds
no elements)InspectableBinaryTree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |