edu.hawaii.ics.yucheng
Class JadeSolver.GraphData

java.lang.Object
  extended by edu.hawaii.ics.yucheng.JadeSolver.GraphData
All Implemented Interfaces:
java.lang.Iterable<JadeSolver.VertexNode>
Enclosing class:
JadeSolver

 class JadeSolver.GraphData
extends java.lang.Object
implements java.lang.Iterable<JadeSolver.VertexNode>

A class that encapsulates the graph file conveniently for the algorithm.


Field Summary
private  Matrix<java.lang.Boolean> myConnections
           
private  Graph myData
           
private  java.util.ArrayList<JadeSolver.VertexNode> myVertices
           
 
Constructor Summary
JadeSolver.GraphData(Graph graph)
          Initializes a new instance of the class.
 
Method Summary
 boolean isConnected(int first, int second)
          Returns true if the specified vertices are connected.
 java.util.Iterator<JadeSolver.VertexNode> iterator()
          Returns a vertex node iterator.
 JadeSolver.VertexNode nodeAt(int index)
          Returns the vertex node at the specified index.
 java.lang.String toString()
          Returns the string representation of the class data.
 int vertices()
          Returns the number of vertices.
 float weightAt(int index)
          Returns the weight of the specified vertex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myConnections

private final Matrix<java.lang.Boolean> myConnections

myData

private final Graph myData

myVertices

private final java.util.ArrayList<JadeSolver.VertexNode> myVertices
Constructor Detail

JadeSolver.GraphData

public JadeSolver.GraphData(Graph graph)
Initializes a new instance of the class.

Parameters:
graph - The graph file data.
Method Detail

isConnected

public boolean isConnected(int first,
                           int second)
Returns true if the specified vertices are connected.

Parameters:
first - The first vertex.
second - The second vertex.
Returns:
True indicates the vertices are connected.

iterator

public java.util.Iterator<JadeSolver.VertexNode> iterator()
Returns a vertex node iterator.

Specified by:
iterator in interface java.lang.Iterable<JadeSolver.VertexNode>
Returns:
A vertex node iterator.

nodeAt

public JadeSolver.VertexNode nodeAt(int index)
Returns the vertex node at the specified index.

Parameters:
index - The index.
Returns:
The vertex node at the specified index.

toString

public java.lang.String toString()
Returns the string representation of the class data.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of the class data.

vertices

public int vertices()
Returns the number of vertices.

Returns:
The number of vertices.

weightAt

public float weightAt(int index)
Returns the weight of the specified vertex.

Parameters:
index - The vertex index.
Returns:
The weight of the vertex.