com.vinculumtech.carrierwave.plan
Class Navigation

java.lang.Object
  extended bycom.vinculumtech.carrierwave.plan.Navigation

public final class Navigation
extends java.lang.Object

The Navigation class provides a set of utilities for retrieving elements from image graphs via directed graph nodes.

A directed graph node, is a child node in a graph node tree. It represents a position in an image graph.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/plan/Navigation.java#19 $

Method Summary
static java.util.Collection findAllIcons(GraphNode originNode, Image originImage)
          Returns a List of all the Icon instances the given node tree touches in the ImageGraph instance rooted by the given originImage.
static java.util.Collection findAllIcons(GraphPlan graphPlan, Image originImage)
          Returns a List of all the Icon instances for the given depth.
static java.util.Collection findDanglingIcons(GraphNode originNode, Image originImage)
          Returns a collection of all the Icon instances the given node tree does not touch.
static java.util.Collection findDanglingImages(GraphNode originNode, Image originImage)
          Returns a collection of all the Image instances the given node tree does not touch.
static java.util.List findDescendantIconsOf(Image originImage, GraphNode leafNode)
          Returns a List of all the Icon instances than can be reached by the given leafNode value.
A leaf node is a node in a graph node tree.
static java.util.List findDescendantsOf(Image originImage, GraphNode leafNode)
          Returns a List of all the Image instances than can be reached by the given leafNode value.
A leaf node is a node in a graph node tree.
static java.lang.Object getChildAsIcons(GraphNode graphNode, Image parentImage)
          Returns the child object referenced by the given GraphNode instance from the given parentImage.
If the graphNode parameter references an edge, the value will be returned as an Icon, or container of Icons (ArrayList or HashMap).
static java.lang.Object getChildAsIconsNarrow(GraphNode graphNode, Image parentImage)
          Returns the child object referenced by the given GraphNode instance from the given parentImage.
If the graphNode parameter references an edge, the value will be returned as an Icon, or container of Icons (ImageArray or ImageMap).
static java.lang.Object getChildAsImages(GraphNode graphNode, Image parentImage)
          Returns the child object referenced by the given GraphNode instance from the given parentImage.
If the graphNode parameter references an edge, the value will be returned as an Image, or container of Images (ImageArray or ImageMap).
static java.lang.Object narrowValue(GraphNode graphNode, java.lang.Object value)
           
static void setChild(GraphNode graphNode, Image parentImage, java.lang.Object child)
          Sets the given child value on the parentImage at the location referenced by the graphNode parameter.
Note the child parameter may be null.
static void setChildIcon(GraphNode graphNode, Image parentImage, Icon childIcon)
          Sets the given childIcon on the parentImage at the location referenced by the graphNode parameter.
Note the childIcon may not be null if the graphNode references a position in a List.
static void setChildImage(GraphNode graphNode, Image parentImage, Image childImage)
          Sets the given childImage on the parentImage at the location referenced by the graphNode parameter.
Note the childImage may not be null if the graphNode references a position in a List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findDescendantsOf

public static final java.util.List findDescendantsOf(Image originImage,
                                                     GraphNode leafNode)
                                              throws GraphException
Returns a List of all the Image instances than can be reached by the given leafNode value.
A leaf node is a node in a graph node tree. The origin node in the tree should match the originImage.

Parameters:
originImage -
leafNode -
Returns:
Throws:
GraphException

findDescendantIconsOf

public static final java.util.List findDescendantIconsOf(Image originImage,
                                                         GraphNode leafNode)
                                                  throws GraphException
Returns a List of all the Icon instances than can be reached by the given leafNode value.
A leaf node is a node in a graph node tree. The origin node in the tree should match the originImage.

Parameters:
originImage -
leafNode -
Returns:
Throws:
GraphException

findDanglingImages

public static final java.util.Collection findDanglingImages(GraphNode originNode,
                                                            Image originImage)
                                                     throws GraphException
Returns a collection of all the Image instances the given node tree does not touch. Use this method to determine if the graphPlan is complete. The returned Collection should be empty if the given graphPlan sufficiently describes the ImageGraph rooted at the originImage.
Note that if the given ImageGraph instance has Icons added without Image instances, they will not be detected. Use findDanglingIcons to find all dangling references in the given ImageGraph.

Parameters:
originNode -
originImage -
Returns:
Throws:
GraphException

findDanglingIcons

public static final java.util.Collection findDanglingIcons(GraphNode originNode,
                                                           Image originImage)
                                                    throws GraphException
Returns a collection of all the Icon instances the given node tree does not touch. Use this method to determine if the graphPlan is complete. The returned Collection should be empty if the given graphPlan sufficiently describes the ImageGraph rooted at the originImage.

Parameters:
originNode -
originImage -
Returns:
Throws:
GraphException

findAllIcons

public static final java.util.Collection findAllIcons(GraphNode originNode,
                                                      Image originImage)
                                               throws GraphException
Returns a List of all the Icon instances the given node tree touches in the ImageGraph instance rooted by the given originImage.

Parameters:
originNode -
originImage -
Returns:
Throws:
GraphException

findAllIcons

public static final java.util.Collection findAllIcons(GraphPlan graphPlan,
                                                      Image originImage)
                                               throws GraphException
Returns a List of all the Icon instances for the given depth.
Parameters:
graphPlan -
originImage -
Returns:
Throws:
GraphException

getChildAsIconsNarrow

public static final java.lang.Object getChildAsIconsNarrow(GraphNode graphNode,
                                                           Image parentImage)
                                                    throws EdgeNotFoundException,
                                                           GraphException
Returns the child object referenced by the given GraphNode instance from the given parentImage.
If the graphNode parameter references an edge, the value will be returned as an Icon, or container of Icons (ImageArray or ImageMap). Otherwise the literal object will be returned.
If the graphNode references a contained element (by index or key), it will be extracted from the container (thus narrowing).

Parameters:
graphNode -
parentImage -
Returns:
Throws:
EdgeNotFoundException
GraphException

getChildAsIcons

public static final java.lang.Object getChildAsIcons(GraphNode graphNode,
                                                     Image parentImage)
                                              throws EdgeNotFoundException,
                                                     GraphException
Returns the child object referenced by the given GraphNode instance from the given parentImage.
If the graphNode parameter references an edge, the value will be returned as an Icon, or container of Icons (ArrayList or HashMap). Otherwise the literal object will be returned.
If the graphNode references a contained element (by index or key), it will NOT be extracted from the container, the container will be returned instead.

Parameters:
graphNode -
parentImage -
Returns:
Throws:
EdgeNotFoundException
GraphException

getChildAsImages

public static final java.lang.Object getChildAsImages(GraphNode graphNode,
                                                      Image parentImage)
                                               throws EdgeNotFoundException,
                                                      GraphException
Returns the child object referenced by the given GraphNode instance from the given parentImage.
If the graphNode parameter references an edge, the value will be returned as an Image, or container of Images (ImageArray or ImageMap). Otherwise the literal object will be returned.
If the graphNode references a contained element (by index or key), it will NOT be extracted from the container, the container will be returned instead.

Parameters:
graphNode -
parentImage -
Returns:
Throws:
EdgeNotFoundException
GraphException

setChildImage

public static final void setChildImage(GraphNode graphNode,
                                       Image parentImage,
                                       Image childImage)
                                throws EdgeNotFoundException,
                                       GraphException
Sets the given childImage on the parentImage at the location referenced by the graphNode parameter.
Note the childImage may not be null if the graphNode references a position in a List. Order is not guaranteed in Lists (as per persistence mechanisms).

Parameters:
graphNode -
parentImage -
childImage -
Throws:
EdgeNotFoundException
GraphException

setChildIcon

public static final void setChildIcon(GraphNode graphNode,
                                      Image parentImage,
                                      Icon childIcon)
                               throws EdgeNotFoundException,
                                      GraphException
Sets the given childIcon on the parentImage at the location referenced by the graphNode parameter.
Note the childIcon may not be null if the graphNode references a position in a List. Order is not guaranteed in Lists (as per persistence mechanisms).

Parameters:
graphNode -
parentImage -
childIcon -
Throws:
EdgeNotFoundException
GraphException

setChild

public static final void setChild(GraphNode graphNode,
                                  Image parentImage,
                                  java.lang.Object child)
                           throws EdgeNotFoundException,
                                  GraphException
Sets the given child value on the parentImage at the location referenced by the graphNode parameter.
Note the child parameter may be null. This method will not insert a value into a container.

Parameters:
graphNode -
parentImage -
child -
Throws:
EdgeNotFoundException
GraphException

narrowValue

public static final java.lang.Object narrowValue(GraphNode graphNode,
                                                 java.lang.Object value)


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.