ch.bfh.algo.core.forest
Class GenericBinaryForestGraph<E,P extends GenericBinaryNode<E,P>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by ch.bfh.algo.core.sequence.GenericLinkedSequence<V,PV>
                  extended by ch.bfh.algo.core.graph.GenericAdjacencyListGraph<Object,E,GenericLink<E,P>,P>
                      extended by ch.bfh.algo.core.forest.GenericForestGraph<E,P>
                          extended by ch.bfh.algo.core.forest.GenericBinaryForestGraph<E,P>
All Implemented Interfaces:
BinaryForest<E>, Container<E>, GenericBinaryForest<E,P>, GenericContainer<E,P>, GenericForest<E,P>, GenericGraph<Object,E,GenericLink<E,P>,P>, GenericSequence<E,P>, Forest<E>, Graph<Object,E>, Sequence<E>, Iterable<E>, Collection<E>, List<E>
Direct Known Subclasses:
DefaultBinaryForest

public class GenericBinaryForestGraph<E,P extends GenericBinaryNode<E,P>>
extends GenericForestGraph<E,P>
implements GenericBinaryForest<E,P>


Field Summary
 
Fields inherited from class ch.bfh.algo.core.graph.GenericAdjacencyListGraph
factory
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
GenericBinaryForestGraph(ForestFactory<P> factory)
           
 
Method Summary
 P childLeft(P parent)
           
 P childLeft(Position<?> parent)
          Access the left child of a given node (the parent).
 P childRight(P parent)
           
 P childRight(Position<?> parent)
          Access the right child of a given node (the parent).
 void cut(P child)
           
 E deleteVertex(P node)
           
 void link(P parent, P child)
           
 void linkAfter(P parent, P child)
           
 void linkBefore(P parent, P child)
           
 void linkLeft(Position<?> parent, Position<?> child)
          Creates a link (parent-child relationship) between a node, the parent, and another node, the child The child should not have any parent, i.e.
 void linkLeft(P parent, P child)
           
 void linkRight(Position<?> parent, Position<?> child)
          Creates a link (parent-child relationship) between a node, the parent, and another node, the child The child should not have any parent, i.e.
 void linkRight(P parent, P child)
           
 
Methods inherited from class ch.bfh.algo.core.forest.GenericForestGraph
children, cut, insertBetween, link, linkAfter, linkBefore, parent, roots
 
Methods inherited from class ch.bfh.algo.core.graph.GenericAdjacencyListGraph
adjacentVertices, adjacentVertices, delete, deleteEdge, deleteEdge, deleteVertex, destination, destination, detach, detachVertex, edgeElement, edgeElement, edgeElements, edges, edges, getFactory, incidentEdges, incidentEdges, insertAfter, insertBefore, insertEdge, insertEdge, insertEdge, insertVertex, isDirected, isDirected, opposite, opposite, origin, origin, positionListIterator, positionListIterator, replaceEdge, replaceVertex, reverse, reverse, setDestination, setDestination, setDirected, setDirected, setOrigin, setOrigin, setOriginAfter, setOriginBefore, setUndirected, setUndirected, swapEdge, swapVertex, vertexElement, vertexElements, vertices
 
Methods inherited from class ch.bfh.algo.core.sequence.GenericLinkedSequence
after, after, before, before, delete, element, element, encloses, encloses, first, head, insert, insert, insertAfter, insertBefore, insertBetween, last, listIterator, position, positionIterator, rank, rank, replace, replace, size, swap, swap, tail, validate
 
Methods inherited from class java.util.AbstractSequentialList
add, addAll, get, iterator, remove, set
 
Methods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.bfh.algo.Forest
children, cut, link, linkAfter, linkBefore, parent, roots
 
Methods inherited from interface ch.bfh.algo.Container
delete, element, encloses, insert, positionIterator, replace, swap
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface ch.bfh.algo.core.GenericContainer
insert, positionIterator
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Constructor Detail

GenericBinaryForestGraph

public GenericBinaryForestGraph(ForestFactory<P> factory)
Method Detail

childLeft

public P childLeft(Position<?> parent)
Description copied from interface: BinaryForest
Access the left child of a given node (the parent).

Specified by:
childLeft in interface BinaryForest<E>
Specified by:
childLeft in interface GenericBinaryForest<E,P extends GenericBinaryNode<E,P>>
Parameters:
parent - the node of which we want the left child
Returns:
the left child of the parent

childLeft

public P childLeft(P parent)

childRight

public P childRight(Position<?> parent)
Description copied from interface: BinaryForest
Access the right child of a given node (the parent).

Specified by:
childRight in interface BinaryForest<E>
Specified by:
childRight in interface GenericBinaryForest<E,P extends GenericBinaryNode<E,P>>
Parameters:
parent - the node of which we want the right child
Returns:
the right child of the parent

childRight

public P childRight(P parent)

link

public void link(P parent,
                 P child)
Overrides:
link in class GenericForestGraph<E,P extends GenericBinaryNode<E,P>>

linkAfter

public void linkAfter(P parent,
                      P child)
Overrides:
linkAfter in class GenericForestGraph<E,P extends GenericBinaryNode<E,P>>

linkBefore

public void linkBefore(P parent,
                       P child)
Overrides:
linkBefore in class GenericForestGraph<E,P extends GenericBinaryNode<E,P>>

linkLeft

public void linkLeft(Position<?> parent,
                     Position<?> child)
Description copied from interface: BinaryForest
Creates a link (parent-child relationship) between a node, the parent, and another node, the child The child should not have any parent, i.e. it is a root.

Specified by:
linkLeft in interface BinaryForest<E>
Parameters:
parent - The node receiving a new left child
child - The node becoming the new left child

linkLeft

public void linkLeft(P parent,
                     P child)

linkRight

public void linkRight(Position<?> parent,
                      Position<?> child)
Description copied from interface: BinaryForest
Creates a link (parent-child relationship) between a node, the parent, and another node, the child The child should not have any parent, i.e. it is a root.

Specified by:
linkRight in interface BinaryForest<E>
Parameters:
parent - The node receiving a new left child
child - The node becoming the new left child

linkRight

public void linkRight(P parent,
                      P child)

cut

public void cut(P child)
Overrides:
cut in class GenericForestGraph<E,P extends GenericBinaryNode<E,P>>

deleteVertex

public E deleteVertex(P node)
Overrides:
deleteVertex in class GenericForestGraph<E,P extends GenericBinaryNode<E,P>>