|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vinculumtech.carrierwave.plan.GraphNode
GraphNode instances represent nodes in a graph node tree or a graph plan.
Graph plans are used to describe the closure of a graph of Image
or Imageable
instances, and
is interchangeable between each. A graph plan is simply a flat representation (tree) of an
object graph closure. An analogy would be to consider a graph plan a type or class, and an object
graph an instance of a graph plan.
Any given instance of a GraphNode may only appear once in a graph node tree, they may not be reused. GraphNodes
are re-entrant, subsequently graph plans are re-entrant and may be used concurrently.
Field Summary | |
static int |
NO_INDEX
No index value. |
static java.lang.Object |
NO_KEY
No key value. |
Constructor Summary | |
GraphNode()
|
|
GraphNode(java.lang.Class type)
Creates an origin node. |
|
GraphNode(java.lang.String typeName)
Creates an origin node. |
|
GraphNode(java.lang.String typeName,
java.lang.String edge)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
boolean isReadOnly,
boolean isReferenceOnly)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
boolean isReadOnly,
boolean isReferenceOnly,
boolean isLiteral)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
int index)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
int index,
boolean isReadOnly,
boolean isReferenceOnly)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
int index,
boolean isReadOnly,
boolean isReferenceOnly,
boolean isLiteral)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
java.lang.Object key)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
java.lang.Object key,
boolean isReadOnly,
boolean isReferenceOnly)
|
|
GraphNode(java.lang.String typeName,
java.lang.String edge,
java.lang.Object key,
boolean isReadOnly,
boolean isReferenceOnly,
boolean isLiteral)
|
Method Summary | |
GraphNode |
addChildNode(GraphNode childNode)
Adds the given GraphNode instance to the graph node tree this GraphNode instance is a member of. Note that GraphNode instances may only belong to one tree, and may only be added to a tree once. |
java.lang.Object |
clone()
|
GraphNode |
cloneShallow()
|
GraphNode |
findChildNodeWith(java.lang.String fullEdge)
Searches for an immediate child GraphNode instance with the given fullEdge value. |
GraphNode |
findChildNodeWith(java.lang.String edge,
boolean isFullEdge)
|
java.util.List |
getAllNodes()
Returns a List of all GraphNode instances in this node tree, including this GraphNode instance. The List will include all GraphNodeSet instances, but not the GraphNode peer instances in the GraphNodeSet but will include the children of the peer node instances. |
java.util.List |
getAllParentNodes()
Returns new List of all the parents of this GraphNode instance, up to and including the origin node. |
java.util.List |
getChildren()
|
int |
getDepth()
The origin node has a depth of zero. |
java.lang.String |
getEdge()
|
java.lang.String |
getFullEdge()
Returns the full edge, of the forms: foo foo[] foo<> foo[0] foo<key> |
protected GraphPlan |
getGraphPlan()
|
int |
getIndex()
|
java.lang.Object |
getKey()
|
java.util.List |
getNodePath()
Returns new List containing this GraphNode instance and all the parents of this GraphNode instance, up to and including the origin GraphNode instance. |
GraphNode |
getOriginNode()
|
protected GraphNode |
getOriginNodeOrThis()
|
GraphNode |
getParentNode()
|
java.lang.String |
getTypeName()
|
boolean |
hasChildren()
|
boolean |
isContained()
|
boolean |
isContainer()
|
boolean |
isList()
|
boolean |
isLiteral()
|
boolean |
isMap()
|
boolean |
isNodeSet()
|
boolean |
isOrigin()
|
boolean |
isReadOnly()
|
boolean |
isReferenceOnly()
Marks this node as a reference-only node in the graph it represents. |
void |
removeChildNode(GraphNode childNode)
Removes the given child GraphNode instance from the graph node tree this GraphNode instance is a member of. The removed childNode may be re-used. |
void |
resetIndex(int index)
Forces the element index this GraphNode instance refereces to be the given index value. This method is intended for use by internal tools. |
void |
resetKey(java.lang.Object key)
Forces the element key this GraphNode instance refereces to be the given key value. This method is intended for use by internal tools. |
void |
setEdge(java.lang.String fullEdge)
Sets the fullEdge the GraphNode instance represents. |
protected void |
setGraphPlan(GraphPlan graphPlan)
|
void |
setIndex(int index)
Sets the element index this GraphNode instance refereces to be the given index value. If the index or key is already set for this GraphNode instance, and IllegalStateException will be thrown. |
void |
setKey(java.lang.Object key)
Sets the element key this GraphNode instance refereces to be the given key value. If the index or key is already set for this GraphNode instance, and IllegalStateException will be thrown. |
void |
setLiteral(boolean literal)
|
protected void |
setOriginNode(GraphNode originNode)
|
protected void |
setParentNode(GraphNode parentNode)
|
void |
setReadOnly(boolean isReadOnly)
Marks this node as a read-only node in the graph it represents. |
void |
setReferenceOnly(boolean referenceOnly)
|
void |
setTypeName(java.lang.String typeName)
Sets the Class typeName this GraphNode instance represents. Note, this value should not be null, but is currently not enforced. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_INDEX
public static final java.lang.Object NO_KEY
Constructor Detail |
public GraphNode()
public GraphNode(java.lang.Class type)
type
- public GraphNode(java.lang.String typeName)
typeName
- public GraphNode(java.lang.String typeName, java.lang.String edge, boolean isReadOnly, boolean isReferenceOnly)
public GraphNode(java.lang.String typeName, java.lang.String edge, int index, boolean isReadOnly, boolean isReferenceOnly)
public GraphNode(java.lang.String typeName, java.lang.String edge, java.lang.Object key, boolean isReadOnly, boolean isReferenceOnly)
public GraphNode(java.lang.String typeName, java.lang.String edge, boolean isReadOnly, boolean isReferenceOnly, boolean isLiteral)
public GraphNode(java.lang.String typeName, java.lang.String edge, int index, boolean isReadOnly, boolean isReferenceOnly, boolean isLiteral)
public GraphNode(java.lang.String typeName, java.lang.String edge, java.lang.Object key, boolean isReadOnly, boolean isReferenceOnly, boolean isLiteral)
public GraphNode(java.lang.String typeName, java.lang.String edge)
public GraphNode(java.lang.String typeName, java.lang.String edge, int index)
public GraphNode(java.lang.String typeName, java.lang.String edge, java.lang.Object key)
Method Detail |
public boolean isLiteral()
public void setLiteral(boolean literal)
public boolean isOrigin()
protected void setOriginNode(GraphNode originNode)
public GraphNode getOriginNode()
protected GraphNode getOriginNodeOrThis()
this
if this instance is the originprotected void setGraphPlan(GraphPlan graphPlan)
protected GraphPlan getGraphPlan()
public boolean isNodeSet()
protected void setParentNode(GraphNode parentNode)
parentNode
- public GraphNode getParentNode()
public java.util.List getAllParentNodes()
public java.util.List getAllNodes()
public java.util.List getNodePath()
public int getDepth()
public boolean isContainer()
public boolean isContained()
public boolean isList()
public boolean isMap()
public void resetIndex(int index)
index
- public void setIndex(int index)
index
- public int getIndex()
public void resetKey(java.lang.Object key)
key
- public void setKey(java.lang.Object key)
key
- public java.lang.Object getKey()
public void setTypeName(java.lang.String typeName)
typeName
- public java.lang.String getTypeName()
public void setEdge(java.lang.String fullEdge)
fullEdge
- public java.lang.String getEdge()
public java.lang.String getFullEdge()
public void setReadOnly(boolean isReadOnly)
isReadOnly
- public boolean isReadOnly()
public boolean isReferenceOnly()
public void setReferenceOnly(boolean referenceOnly)
referenceOnly
- true if this GraphNode instance represents a reference-only nodepublic GraphNode addChildNode(GraphNode childNode)
childNode
-
java.lang.IllegalStateException
- if the given GraphNode instance has already been added to a parent nodepublic void removeChildNode(GraphNode childNode)
childNode
- public GraphNode findChildNodeWith(java.lang.String fullEdge)
fullEdge
-
public GraphNode findChildNodeWith(java.lang.String edge, boolean isFullEdge)
public java.util.List getChildren()
public boolean hasChildren()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public GraphNode cloneShallow()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |