nz.ac.waikato.jdsl.core.api
Interface PositionalContainer

All Superinterfaces:
Container, InspectableContainer, InspectablePositionalContainer
All Known Subinterfaces:
BinaryTree, Graph, ModifiableGraph, Sequence, Tree
All Known Implementing Classes:
AbstractGraph, AbstractPositionalContainer, ArraySequence, IncidenceListGraph, NodeBinaryTree, NodeSequence, NodeTree

public interface PositionalContainer
extends InspectablePositionalContainer, Container

Positional containers (for example, sequences, trees, and graphs) are containers in which elements are related to each other through adjacency information.

A positional container stores elements at its positions and defines adjacency relationships between the positions (for example, before/after in a sequence, parent/child in a tree). Thus, the model of storage is topological -- i.e., a positional container is a graph, or some restricted version of a graph. This means that the position at which an element is stored is decided by the user and is arbitrary from the point of view of the container.

Version:
JDSL 2.1.1
Author:
Mark Handy, Michael T. Goodrich, Roberto Tamassia, Mike Boilen (mgb), Andrew Schwerin (schwerin)
See Also:
Position, Container

Method Summary
 void swapElements(Position a, Position b)
          Swaps the elements associated with the two positions, leaving the positions themselves "where" they were.
 
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, isEmpty, size
 

Method Detail

swapElements

void swapElements(Position a,
                  Position b)
                  throws InvalidAccessorException
Swaps the elements associated with the two positions, leaving the positions themselves "where" they were.

Parameters:
a - First Position to swap
b - Second Position to swap
Throws:
InvalidAccessorException - if either of a and b is null or does not belong to this positional container


Copyright © 2009 ModelJUnit Project. All Rights Reserved.