com.vinculumtech.carrierwave.plan
Class GraphPlan

java.lang.Object
  extended bycom.vinculumtech.carrierwave.plan.GraphPlan
All Implemented Interfaces:
java.io.Serializable

public class GraphPlan
extends java.lang.Object
implements java.io.Serializable

The GraphPlan class describes the closure of an Image or Imageable object graph.

This is accomplished by holding a tree of GraphNode instances (graph node tree), or the the meta-data used to create on during runtime.

Node trees generated at runtime are created using either the type of the origin node, or an instance of the origin node. When using the type, the node tree is referred to as static, since it describes the most general case possible for a given depth, etc. When generated with an instance of an Image or Imageable object, it is a runtime graph node tree.

GraphPlan instances are intended to be persisted in the repository and reused by client applications.
todo: need a way to make plans immutable??

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/plan/GraphPlan.java#11 $
See Also:
Serialized Form

Field Summary
static int ALL_CHILDREN
          Infinite (whole graph) depth.
static char VERSION_DELIM
          The version delimiter used in full graph plan names.
 
Constructor Summary
protected GraphPlan()
           
  GraphPlan(GraphNode originNode)
          Creates a new instance of a GraphPlan.
  GraphPlan(GraphNode originNode, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
  GraphPlan(int depth)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true.
  GraphPlan(int depth, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true.
  GraphPlan(int depth, boolean ignoreReadOnly, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true.
  GraphPlan(int depth, boolean ignoreReadOnly, boolean dependentsInclusive, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
  GraphPlan(java.lang.String fullName, GraphNode originNode)
          Creates a new instance of a GraphPlan.
  GraphPlan(java.lang.String fullName, GraphNode originNode, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
  GraphPlan(java.lang.String fullName, int depth)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true.
  GraphPlan(java.lang.String fullName, int depth, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true.
  GraphPlan(java.lang.String fullName, int depth, boolean ignoreReadOnly, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true.
  GraphPlan(java.lang.String fullName, int depth, boolean ignoreReadOnly, boolean dependentsInclusive, boolean isFuzzy)
          Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
 
Method Summary
 java.util.List getAllNodes()
          Returns all GraphNode instances in this GraphPlan.
This includes GraphNodeSets, but not the GraphNode peer instances in the set, only their children nodes.
 int getDepth()
          The number of edges to traverse.
 java.lang.String getFullName()
           
 java.lang.String getName()
           
 GraphNode getOriginNode()
           
 long getVersion()
           
 boolean isDependentsInclusive()
          If depth should be extended (automatically) to include dependent children in the resulting graph.
 boolean isFuzzy()
          If leaf nodes should be returned as Icon instances instead of Image instances.
 boolean isIgnoreReadOnly()
          If read-only edges should be traversed.
 void setDependentsInclusive(boolean dependentsInclusive)
           
 void setDepth(int depth)
           
 void setFullName(java.lang.String fullName)
          Sets the full name of this GraphPlan instance.
The full name consists of the name and version, for example:
simple.graphPlan#2
 void setFuzzy(boolean fuzzy)
           
 void setIgnoreReadOnly(boolean ignoreReadOnly)
           
 void setName(java.lang.String name)
          Sets the simple name of this GraphPlan instance.
 void setVersion(long version)
          Sets the version of this GraphPlan instance.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_CHILDREN

public static final int ALL_CHILDREN
Infinite (whole graph) depth.

See Also:
Constant Field Values

VERSION_DELIM

public static char VERSION_DELIM
The version delimiter used in full graph plan names.

Constructor Detail

GraphPlan

protected GraphPlan()

GraphPlan

public GraphPlan(java.lang.String fullName,
                 GraphNode originNode)
Creates a new instance of a GraphPlan.

Parameters:
fullName - the name of this GraphPlan instance, optionally versioned, may be null
originNode - the root node of a graph node tree

GraphPlan

public GraphPlan(java.lang.String fullName,
                 GraphNode originNode,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.

Parameters:
fullName - the name of this GraphPlan instance, optionally versioned, may be null
originNode - the root node of a graph node tree
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(GraphNode originNode)
Creates a new instance of a GraphPlan.

Parameters:
originNode - the root node of a graph node tree

GraphPlan

public GraphPlan(GraphNode originNode,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.

Parameters:
originNode - the root node of a graph node tree
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(java.lang.String fullName,
                 int depth,
                 boolean ignoreReadOnly,
                 boolean dependentsInclusive,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.

Parameters:
fullName - the name of this GraphPlan instance, optionally versioned, may be null
depth - the number of edge traversals to include in the resulting graph
ignoreReadOnly - set to true if read-only edges should not be traversed
dependentsInclusive - set to true if depth should be extended to include a dependent child
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(java.lang.String fullName,
                 int depth,
                 boolean ignoreReadOnly,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true. This prevents a certain class of errors that would occur during on-demand faulting of Image instances.

Parameters:
fullName - the name of this GraphPlan instance, optionally versioned, may be null
depth - the number of edge traversals to include in the resulting graph
ignoreReadOnly - set to true if read-only edges should not be traversed
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(java.lang.String fullName,
                 int depth,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true. This prevents a certain class of errors that would occur during on-demand faulting of Image instances.

Parameters:
fullName - the name of this GraphPlan instance, optionally versioned, may be null
depth - the number of edge traversals to include in the resulting graph
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(java.lang.String fullName,
                 int depth)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true. This prevents a certain class of errors that would occur during on-demand faulting of Image instances.

Parameters:
fullName - the name of this GraphPlan instance, optionally versioned, may be null
depth - the number of edge traversals to include in the resulting graph

GraphPlan

public GraphPlan(int depth,
                 boolean ignoreReadOnly,
                 boolean dependentsInclusive,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.

Parameters:
depth - the number of edge traversals to include in the resulting graph
ignoreReadOnly - set to true if read-only edges should not be traversed
dependentsInclusive - set to true if depth should be extended to include a dependent child
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(int depth,
                 boolean ignoreReadOnly,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true. This prevents a certain class of errors that would occur during on-demand faulting of Image instances.

Parameters:
depth - the number of edge traversals to include in the resulting graph
ignoreReadOnly - set to true if read-only edges should not be traversed
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(int depth,
                 boolean isFuzzy)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true. This prevents a certain class of errors that would occur during on-demand faulting of Image instances.

Parameters:
depth - the number of edge traversals to include in the resulting graph
isFuzzy - set to true if leaf nodes should be returned as Icon instances instead of Image instances

GraphPlan

public GraphPlan(int depth)
Creates a new instance of a GraphPlan.
A graph node tree will be generated on demand with the given meta-data.
Note, for convenience, if isFuzzy is true, dependentsInclusive will be set to true. This prevents a certain class of errors that would occur during on-demand faulting of Image instances.

Parameters:
depth - the number of edge traversals to include in the resulting graph
Method Detail

setName

public void setName(java.lang.String name)
Sets the simple name of this GraphPlan instance.

Parameters:
name -

getName

public java.lang.String getName()
Returns:
the simple name of this GraphPlan instance.

setFullName

public void setFullName(java.lang.String fullName)
Sets the full name of this GraphPlan instance.
The full name consists of the name and version, for example:
simple.graphPlan#2

Parameters:
fullName -

getFullName

public java.lang.String getFullName()
Returns:
the full name of this GraphPlan instance

setVersion

public void setVersion(long version)
Sets the version of this GraphPlan instance.

Parameters:
version -

getVersion

public long getVersion()

getOriginNode

public GraphNode getOriginNode()
Returns:
the root of a graph node tree this plan owns

getAllNodes

public java.util.List getAllNodes()
Returns all GraphNode instances in this GraphPlan.
This includes GraphNodeSets, but not the GraphNode peer instances in the set, only their children nodes.

Returns:

getDepth

public int getDepth()
The number of edges to traverse.

Returns:

setDepth

public void setDepth(int depth)

isIgnoreReadOnly

public boolean isIgnoreReadOnly()
If read-only edges should be traversed.

Returns:

setIgnoreReadOnly

public void setIgnoreReadOnly(boolean ignoreReadOnly)

isDependentsInclusive

public boolean isDependentsInclusive()
If depth should be extended (automatically) to include dependent children in the resulting graph.

Returns:

setDependentsInclusive

public void setDependentsInclusive(boolean dependentsInclusive)

isFuzzy

public boolean isFuzzy()
If leaf nodes should be returned as Icon instances instead of Image instances.

Returns:

setFuzzy

public void setFuzzy(boolean fuzzy)

toString

public java.lang.String toString()


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