annas.graph.generate
Class LinearGraphGenerator<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.generate.LinearGraphGenerator<N,A>
Type Parameters:
N - Node type
A - Arc type
All Implemented Interfaces:
GraphGenerator<N,A>

public class LinearGraphGenerator<N,A extends ArcInterface<N>>
extends java.lang.Object
implements GraphGenerator<N,A>

Generates a linear Graph, a straight line graph

Author:
Sam Wilson

Constructor Summary
LinearGraphGenerator(int length)
           
 
Method Summary
 void generate(GraphInterface<N,A> target, NodeFactory<N> factory, java.util.Map<java.lang.String,java.lang.Object> map)
          Generates a graph.
 N getEnd_node()
           
 int getLength()
           
 N getStart_node()
           
 void setEnd_node(N endNode)
           
 void setLength(int length)
           
 void setStart_node(N startNode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearGraphGenerator

public LinearGraphGenerator(int length)
Method Detail

generate

public void generate(GraphInterface<N,A> target,
                     NodeFactory<N> factory,
                     java.util.Map<java.lang.String,java.lang.Object> map)
Generates a graph.

Specified by:
generate in interface GraphGenerator<N,A extends ArcInterface<N>>
Parameters:
target - Target Graph object
factory - Factory for creating nodes.
map - Provides a means of communication data to the generating algorithm.

getStart_node

public N getStart_node()
Returns:
the start_node

setStart_node

public void setStart_node(N startNode)
Parameters:
startNode - the start_node to set

getEnd_node

public N getEnd_node()
Returns:
the end_node

setEnd_node

public void setEnd_node(N endNode)
Parameters:
endNode - the end_node to set

getLength

public int getLength()
Returns:
the length

setLength

public void setLength(int length)
Parameters:
length - the length to set