Package diva.graph

Class GraphUtilities


  • public final class GraphUtilities
    extends java.lang.Object
    A set of utilities for traversing/manipulating/etc. graphs.
    Version:
    $Id$
    Author:
    Michael Shilman
    Pt.AcceptedRating:
    Red
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean checkConsistency​(java.lang.Object composite, GraphModel model)
      Check to make sure that all nodes and edges are self-consistent within a graph.
      static boolean checkContainment​(java.lang.Object composite, GraphModel model)
      Check to make sure that all nodes and edges are contained with in a graph and are consistent.
      static java.util.Set edgeSet​(java.lang.Object composite, GraphModel model)
      Return a new set that contains any edges that are connected to any nodes in the given composite.
      static java.util.Iterator inNodes​(java.lang.Object node, GraphModel model)
      Return an iterator over the nodes on the other side of edges arriving in the given node.
      static boolean isContainedNode​(java.lang.Object node, java.lang.Object composite, GraphModel model)  
      static boolean isPartiallyContainedEdge​(java.lang.Object edge, java.lang.Object composite, GraphModel model)  
      static boolean isTotallyContainedEdge​(java.lang.Object edge, java.lang.Object composite, GraphModel model)  
      static java.util.Iterator localEdges​(java.lang.Object composite, GraphModel model)
      Deprecated.
      use totallyContainedEdges instead.
      static java.util.Set nodeSet​(java.lang.Object composite, GraphModel model)
      Return a new set that contains all the nodes that are deeply contained in the given composite.
      static java.util.Iterator outNodes​(java.lang.Object node, GraphModel model)
      Return an iterator over the nodes on the other side of edges emanating from the given node.
      static java.util.Iterator partiallyContainedEdges​(java.lang.Object composite, GraphModel model)
      Return an iterator over the edges in a graph which are partially contained within the given composite node.
      static void purgeNode​(java.lang.Object eventSource, java.lang.Object node, MutableGraphModel model)
      Disconnect all of the edges connected to the given node, then remove it from its graph.
      static java.util.Iterator totallyContainedEdges​(java.lang.Object composite, GraphModel model)
      Return an iterator over the edges in a graph which are totally contained within the given composite node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkConsistency

        public static final boolean checkConsistency​(java.lang.Object composite,
                                                     GraphModel model)
        Check to make sure that all nodes and edges are self-consistent within a graph.
      • checkContainment

        public static final boolean checkContainment​(java.lang.Object composite,
                                                     GraphModel model)
        Check to make sure that all nodes and edges are contained with in a graph and are consistent.
      • edgeSet

        public static final java.util.Set edgeSet​(java.lang.Object composite,
                                                  GraphModel model)
        Return a new set that contains any edges that are connected to any nodes in the given composite.
      • isContainedNode

        public static boolean isContainedNode​(java.lang.Object node,
                                              java.lang.Object composite,
                                              GraphModel model)
      • isPartiallyContainedEdge

        public static boolean isPartiallyContainedEdge​(java.lang.Object edge,
                                                       java.lang.Object composite,
                                                       GraphModel model)
      • isTotallyContainedEdge

        public static boolean isTotallyContainedEdge​(java.lang.Object edge,
                                                     java.lang.Object composite,
                                                     GraphModel model)
      • inNodes

        public static final java.util.Iterator inNodes​(java.lang.Object node,
                                                       GraphModel model)
        Return an iterator over the nodes on the other side of edges arriving in the given node.
      • nodeSet

        public static final java.util.Set nodeSet​(java.lang.Object composite,
                                                  GraphModel model)
        Return a new set that contains all the nodes that are deeply contained in the given composite.
      • outNodes

        public static final java.util.Iterator outNodes​(java.lang.Object node,
                                                        GraphModel model)
        Return an iterator over the nodes on the other side of edges emanating from the given node.
      • purgeNode

        public static final void purgeNode​(java.lang.Object eventSource,
                                           java.lang.Object node,
                                           MutableGraphModel model)
                                    throws GraphException
        Disconnect all of the edges connected to the given node, then remove it from its graph.
        Throws:
        GraphException - if the operation fails.
      • partiallyContainedEdges

        public static final java.util.Iterator partiallyContainedEdges​(java.lang.Object composite,
                                                                       GraphModel model)
        Return an iterator over the edges in a graph which are partially contained within the given composite node. (i.e. the edges whose head node, or tail node is in the composite, or a subnode).
      • totallyContainedEdges

        public static final java.util.Iterator totallyContainedEdges​(java.lang.Object composite,
                                                                     GraphModel model)
        Return an iterator over the edges in a graph which are totally contained within the given composite node. (i.e. the edges whose head and tail nodes are both in the composite, or a subnode).
      • localEdges

        @Deprecated
        public static final java.util.Iterator localEdges​(java.lang.Object composite,
                                                          GraphModel model)
        Deprecated.
        use totallyContainedEdges instead.
        Return an iterator over the edges in a graph which are local to that graph (i.e. the edges whose head and tail nodes are both in the graph, or a subgraph)