001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2002, Refractions Reserach Inc.
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: */
017: package org.geotools.graph.build;
018:
019: import org.geotools.graph.structure.Graph;
020: import org.geotools.graph.structure.Graphable;
021:
022: /**
023: * Contructs a graph based on relationships between the entities (objects)
024: * modelled by the graph. <BR>
025: * <BR>
026: * The underlying graph is generated by continually adding objects to the
027: * generator. The Generator determines the relationships between the objects
028: * and decides how to model the relationship and the objects themselves in the
029: * graph.<BR>
030: * <BR>
031: * The GraphGenerator is the upper level of the graph construction process.
032: * It is a wrapper around the GraphBuilder class that is intended to
033: * instruct the builder how to build the underyling graph structure.
034: *
035: * @see GraphBuilder
036: *
037: * @author Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
038: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/graph/src/main/java/org/geotools/graph/build/GraphGenerator.java $
039: */
040: public interface GraphGenerator {
041:
042: /**
043: * Adds an object to the graph.
044: *
045: * @param obj The object to be modelled in the graph.
046: *
047: * @return The graph component used to model the object.
048: */
049: public Graphable add(Object obj);
050:
051: /**
052: * Retrieves a component of the graph.
053: *
054: * @param obj The object modelled by the component.
055: *
056: * @return The graph component used to model the object.
057: */
058: public Graphable get(Object obj);
059:
060: /**
061: * Removes an object from the graph.
062: *
063: * @param obj The object modelled by the component.
064: *
065: * @return The graph component used to model the object.
066: */
067: public Graphable remove(Object obj);
068:
069: /**
070: * Sets the underlying builder used to physically construct the graph.
071: *
072: * @param builder The new underlying GraphBuilder.
073: */
074: public void setGraphBuilder(GraphBuilder builder);
075:
076: /**
077: * Returns the underlying builder.
078: *
079: * @return The underyling builder.
080: */
081: public GraphBuilder getGraphBuilder();
082:
083: /**
084: * Returns the graph being generated.
085: *
086: * @return The generated graph.
087: */
088: public Graph getGraph();
089:
090: // /**
091: // * Signals the generator that graph construction is about to begin.
092: // *
093: // */
094: // public void init();
095: //
096: // /**
097: // * Signals that generator that construction of the graph is complete.
098: // */
099: // public void finish();
100: }
|