edu.iu.iv.search.p2p.can
Class CanSearchAlgorithm

java.lang.Object
  |
  +--edu.iu.iv.search.p2p.can.CanSearchAlgorithm
All Implemented Interfaces:
Algorithm

public class CanSearchAlgorithm
extends java.lang.Object
implements Algorithm

Wrapper class for the CAN Search algorithm.

Author:
Hardik Sheth (hsheth@indiana.edu)

Constructor Summary
CanSearchAlgorithm()
          Empty Constructor
CanSearchAlgorithm(edu.uci.ics.jung.graph.Graph graph, int sourceNode, int targetNode)
          Constructor for CanSearchAlgorithm.
 
Method Summary
 boolean execute()
          Runs the algorithm.
 edu.uci.ics.jung.graph.Graph getGraph()
          This method returns the graph object on which the search is performed
 int getSourceNode()
          This method returns the source node in the search
 int getTargetNode()
          This method returns the target node in the search
 void setGraph(edu.uci.ics.jung.graph.Graph graph)
          This method sets the graph object (representing the CAN network) on which search will be performed
 void setSourceNode(int sourceNode)
          This method sets the source node to start the search
 void setTargetNode(int targetNode)
          This method sets the node to be searched (target node)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CanSearchAlgorithm

public CanSearchAlgorithm(edu.uci.ics.jung.graph.Graph graph,
                          int sourceNode,
                          int targetNode)
Constructor for CanSearchAlgorithm. Sets the source and target nodes for search and the file containing the graph.

Parameters:
sourceNode -
targetNode -

CanSearchAlgorithm

public CanSearchAlgorithm()
Empty Constructor

Method Detail

execute

public boolean execute()
Description copied from interface: Algorithm
Runs the algorithm.

Specified by:
execute in interface Algorithm
Returns:
true if the algorithm ran successfully, false otherwise.
See Also:
Algorithm.execute()

getGraph

public edu.uci.ics.jung.graph.Graph getGraph()
This method returns the graph object on which the search is performed

Returns:
graph

getSourceNode

public int getSourceNode()
This method returns the source node in the search

Returns:
source node

getTargetNode

public int getTargetNode()
This method returns the target node in the search

Returns:
target node

setGraph

public void setGraph(edu.uci.ics.jung.graph.Graph graph)
This method sets the graph object (representing the CAN network) on which search will be performed

Parameters:
graph -

setSourceNode

public void setSourceNode(int sourceNode)
This method sets the source node to start the search

Parameters:
sourceNode -

setTargetNode

public void setTargetNode(int targetNode)
This method sets the node to be searched (target node)

Parameters:
targetNode -