com.vinculumtech.carrierwave.graphmodel
Class GraphModel

java.lang.Object
  extended bycom.vinculumtech.carrierwave.graphmodel.GraphModel

public class GraphModel
extends java.lang.Object

The GraphModel class is intended as a simple abstraction for managing the relationships in an ImageGraph instance. Use the GraphModel to remove instances of an Image completely from the graph, or to dynamically walk the graph, or to retrieve a whole graph via a ImageSource. After instantiating an instance of GraphModel, resolve it so that that model matches the underlying ImageGraph. From there add or remove Vertices or Edges from the model. During this process the ImageGraph instance will be in an inconsistent state. Sync the model when the changes are complete.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/graphmodel/GraphModel.java#5 $

Constructor Summary
GraphModel(ImageGraph imageGraph)
           
GraphModel(ImageGraph imageGraph, boolean isLocalOnly)
           
 
Method Summary
 Edge addEdgeFor(java.lang.String name, boolean readOnly, Vertex parentVertex, Vertex childVertex)
           
 Edge addEdgeFor(java.lang.String name, Vertex parentVertex, Vertex childVertex)
           
 Vertex addVertexFor(Icon icon)
           
 Vertex addVertexFor(Image image)
           
 Vertex bindVertexTo(Vertex vertex, Icon icon)
           
 Vertex bindVertexTo(Vertex vertex, Image image)
           
 void clearVertices()
           
 boolean containsVertexFor(Icon icon)
           
 boolean containsVertexFor(Image image)
           
 java.util.List findLeaves()
           
 java.util.List findRoots()
           
 ImageGraph getImageGraph()
           
 Vertex getVertexFor(Icon icon)
          Returns a Vertex instance for the given Icon instance.
 Vertex getVertexFor(Image image)
          Returns a Vertex instance for the given Image instance.
 java.util.List getVertices()
          Returns a copy of the vertices collection.
 java.util.List getVerticesAssignableTo(java.lang.Class type)
           
 void removeEdgeFor(java.lang.String name, Vertex parentVertex)
           
 void resolveModel()
           
 void syncModel()
           
 void syncModel(ImageGraph imageGraph)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphModel

public GraphModel(ImageGraph imageGraph)

GraphModel

public GraphModel(ImageGraph imageGraph,
                  boolean isLocalOnly)
Method Detail

getImageGraph

public ImageGraph getImageGraph()

clearVertices

public void clearVertices()

getVertices

public java.util.List getVertices()
Returns a copy of the vertices collection.


getVerticesAssignableTo

public java.util.List getVerticesAssignableTo(java.lang.Class type)

containsVertexFor

public boolean containsVertexFor(Icon icon)

containsVertexFor

public boolean containsVertexFor(Image image)

getVertexFor

public Vertex getVertexFor(Image image)
Returns a Vertex instance for the given Image instance. If the vertex does not exist one is created.


getVertexFor

public Vertex getVertexFor(Icon icon)
Returns a Vertex instance for the given Icon instance. If the vertex does not exist one is created.


addVertexFor

public Vertex addVertexFor(Icon icon)

addVertexFor

public Vertex addVertexFor(Image image)

bindVertexTo

public Vertex bindVertexTo(Vertex vertex,
                           Image image)

bindVertexTo

public Vertex bindVertexTo(Vertex vertex,
                           Icon icon)

addEdgeFor

public Edge addEdgeFor(java.lang.String name,
                       Vertex parentVertex,
                       Vertex childVertex)

addEdgeFor

public Edge addEdgeFor(java.lang.String name,
                       boolean readOnly,
                       Vertex parentVertex,
                       Vertex childVertex)

removeEdgeFor

public void removeEdgeFor(java.lang.String name,
                          Vertex parentVertex)

syncModel

public void syncModel()

syncModel

public void syncModel(ImageGraph imageGraph)

resolveModel

public void resolveModel()

findLeaves

public java.util.List findLeaves()

findRoots

public java.util.List findRoots()


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