Skip to content
Snippets Groups Projects
Commit 13e81e09 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

Added some javadocs.

parent a5167c99
No related branches found
No related tags found
No related merge requests found
Showing with 134 additions and 2 deletions
......@@ -37,6 +37,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* An AbstractAdjacencyGraph is a Graph implemented using adjacency lists.
*
* @since 2.0
* @param <N> The node type
* @param <E> The type of edge for the given node type
*/
......
......@@ -24,18 +24,43 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* An AbstractBidirectedAdjacencyGraph is a BidirectedGraph implemented using adjacency lists.
*
* @since 2.0
* @param <N> The node type
* @param <E> The type of edge for the given node type
*/
public abstract class AbstractBidirectedAdjacencyGraph<N, E extends BidirectedEdge<N>> extends AbstractAdjacencyGraph<N, E> implements BidirectedGraph<N, E>
{
/**
* Creates a new graph with no edges and no adjacencies.
* nodeContext and edgeContext is enabled.
*/
protected AbstractBidirectedAdjacencyGraph()
{
super();
}
/**
* Creates a new graph as a copy of the current Graph.
* nodeContext is enabled.
* @param copyGraph The Graph to copy
*/
protected AbstractBidirectedAdjacencyGraph(final Graph<N, E> copyGraph)
{
super(copyGraph.getNodes(), copyGraph.getEdges());
}
/**
* Creates a new graph from the given list of nodes, and
* the given list of Edges.
* The adjacency lists are created from this structure. nodeContext is
* enabled.
*
* @param nodes The set of all nodes
* @param edges The set of all ourEdges
*/
protected AbstractBidirectedAdjacencyGraph(final Set<N> nodes, final Set<E> edges)
{
super(nodes, edges);
......
......@@ -20,18 +20,43 @@ package com.syncleus.dann.graph;
import java.util.Set;
/**
* An AbstractDirectedAdjacencyGraph is a DirectedGraph implemented using adjacency lists.
*
* @since 2.0
* @param <N> The node type
* @param <E> The type of edge for the given node type
*/
public abstract class AbstractDirectedAdjacencyGraph<N, E extends DirectedEdge<N>> extends AbstractBidirectedAdjacencyGraph<N, E> implements DirectedGraph<N, E>
{
/**
* Creates a new graph with no edges and no adjacencies.
* nodeContext and edgeContext is enabled.
*/
protected AbstractDirectedAdjacencyGraph()
{
super();
}
/**
* Creates a new graph as a copy of the current Graph.
* nodeContext is enabled.
* @param copyGraph The Graph to copy
*/
protected AbstractDirectedAdjacencyGraph(final Graph<N, E> copyGraph)
{
super(copyGraph.getNodes(), copyGraph.getEdges());
}
/**
* Creates a new graph from the given list of nodes, and
* the given list of Edges.
* The adjacency lists are created from this structure. nodeContext is
* enabled.
*
* @param nodes The set of all nodes
* @param edges The set of all ourEdges
*/
protected AbstractDirectedAdjacencyGraph(final Set<N> nodes, final Set<E> edges)
{
super(nodes, edges);
......
......@@ -20,18 +20,43 @@ package com.syncleus.dann.graph;
import java.util.Set;
/**
* An AbstractHyperAdjacencyGraph is a HyperGraph implemented using adjacency lists.
*
* @since 2.0
* @param <N> The node type
* @param <E> The type of edge for the given node type
*/
public abstract class AbstractHyperAdjacencyGraph<N, E extends HyperEdge<N>> extends AbstractAdjacencyGraph<N, E> implements HyperGraph<N, E>
{
/**
* Creates a new graph with no edges and no adjacencies.
* nodeContext and edgeContext is enabled.
*/
protected AbstractHyperAdjacencyGraph()
{
super();
}
/**
* Creates a new graph as a copy of the current Graph.
* nodeContext is enabled.
* @param copyGraph The Graph to copy
*/
protected AbstractHyperAdjacencyGraph(final Graph<N, E> copyGraph)
{
super(copyGraph.getNodes(), copyGraph.getEdges());
}
/**
* Creates a new graph from the given list of nodes, and
* the given list of Edges.
* The adjacency lists are created from this structure. nodeContext is
* enabled.
*
* @param nodes The set of all nodes
* @param edges The set of all ourEdges
*/
protected AbstractHyperAdjacencyGraph(final Set<N> nodes, final Set<E> edges)
{
super(nodes, edges);
......
......@@ -24,14 +24,31 @@ import com.syncleus.dann.graph.topological.sorter.TopologicalSorter;
import com.syncleus.dann.graph.tree.TreeOptimizedDirectedGraph;
import com.syncleus.dann.graph.tree.Trees;
/**
* An AbstractRootedTreeAdjacencyGraph is a RootedTreeGraph implemented using adjacency lists.
*
* @since 2.0
* @param <N> The node type
* @param <E> The type of edge for the given node type
*/
public abstract class AbstractRootedTreeAdjacencyGraph<N, E extends DirectedEdge<N>> extends AbstractTreeAdjacencyGraph<N, E> implements RootedTreeGraph<N, E>, TreeOptimizedDirectedGraph<N, E>
{
// TODO restrict all edges when added, to make sure they conform to being a rooted tree
/**
* Creates a new graph with no edges and no adjacencies.
* nodeContext and edgeContext is enabled.
*/
protected AbstractRootedTreeAdjacencyGraph()
{
super();
}
/**
* Creates a new graph as a copy of the current Graph.
* nodeContext is enabled.
* @param copyGraph The Graph to copy
*/
protected AbstractRootedTreeAdjacencyGraph(final DirectedGraph<N, E> copyGraph)
{
super(copyGraph.getNodes(), copyGraph.getEdges());
......@@ -39,6 +56,15 @@ public abstract class AbstractRootedTreeAdjacencyGraph<N, E extends DirectedEdge
throw new IllegalArgumentException("copyGraph is not a rooted tree");
}
/**
* Creates a new graph from the given list of nodes, and
* the given list of Edges.
* The adjacency lists are created from this structure. nodeContext is
* enabled.
*
* @param nodes The set of all nodes
* @param edges The set of all ourEdges
*/
protected AbstractRootedTreeAdjacencyGraph(final Set<N> nodes, final Set<E> edges)
{
super(nodes, edges);
......
......@@ -23,15 +23,31 @@ import com.syncleus.dann.graph.topological.Topography;
import com.syncleus.dann.graph.tree.TreeOptimizedGraph;
import com.syncleus.dann.graph.tree.Trees;
/**
* An AbstractTreeAdjacencyGraph is a TreeGraph implemented using adjacency lists.
*
* @since 2.0
* @param <N> The node type
* @param <E> The type of edge for the given node type
*/
public abstract class AbstractTreeAdjacencyGraph<N, E extends BidirectedEdge<N>> extends AbstractBidirectedAdjacencyGraph<N, E> implements TreeGraph<N, E>, TreeOptimizedGraph<N, E>
{
// TODO restrict tree's to only maximally connected trees or perhaps just tree in general
/**
* Creates a new graph with no edges and no adjacencies.
* nodeContext and edgeContext is enabled.
*/
protected AbstractTreeAdjacencyGraph()
{
super();
}
/**
* Creates a new graph as a copy of the current Graph.
* nodeContext is enabled.
* @param copyGraph The Graph to copy
*/
protected AbstractTreeAdjacencyGraph(final BidirectedGraph<N, E> copyGraph)
{
super(copyGraph.getNodes(), copyGraph.getEdges());
......@@ -39,6 +55,15 @@ public abstract class AbstractTreeAdjacencyGraph<N, E extends BidirectedEdge<N>>
throw new IllegalArgumentException("copyGraph is not a Tree");
}
/**
* Creates a new graph from the given list of nodes, and
* the given list of Edges.
* The adjacency lists are created from this structure. nodeContext is
* enabled.
*
* @param nodes The set of all nodes
* @param edges The set of all ourEdges
*/
protected AbstractTreeAdjacencyGraph(final Set<N> nodes, final Set<E> edges)
{
super(nodes, edges);
......
......@@ -30,7 +30,6 @@ import java.util.Set;
* directed edges both ends have opposite orientation, outward on one end and
* inward on the other, such that both ends point in the same direction.
*
* @author Jeffrey Phillips Freeman
* @since 2.0
*/
public interface BidirectedGraph<N, E extends BidirectedEdge<N>> extends Graph<N, E>
......
......@@ -18,6 +18,12 @@
******************************************************************************/
package com.syncleus.dann.graph;
/**
* A type of graph where every edge has exactly 2 end points which always has a
* directionality set to inward on one end and outward ont he other.
*
* @since 2.0
*/
public interface DirectedGraph<N, E extends DirectedEdge<N>> extends BidirectedGraph<N, E>
{
//we need this for the optimizer and utility class operations. We might also want to fill it in later.
......
......@@ -22,7 +22,6 @@ package com.syncleus.dann.graph;
* A type of graph where each edge has 2 or more end points and is undirected so
* each edge can be traversed from any end point of the edge to any end point.
*
* @author Jeffrey Phillips Freeman
* @since 2.0
*/
public interface HyperGraph<N, E extends HyperEdge<N>> extends Graph<N, E>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment