mas.agentsHempelsSofa.data.graph
Class AdjacencyMatrix

java.lang.Object
  extended by mas.agentsHempelsSofa.data.graph.AdjacencyMatrix

public class AdjacencyMatrix
extends java.lang.Object

Provides an adjacency matrix to represent a graph.

Author:
Hempels-Sofa

Constructor Summary
AdjacencyMatrix(Graph g)
          Creates a new adjacency matrix of a given graph g.
 
Method Summary
 int[][] getEntries()
           
 int getEntry(int row, int column)
           
 java.lang.String toCleanString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdjacencyMatrix

public AdjacencyMatrix(Graph g)
Creates a new adjacency matrix of a given graph g.

Parameters:
g - - the given graph
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toCleanString

public java.lang.String toCleanString()
Returns:
a string representation of the adjacency matrix without any other information.

getEntry

public int getEntry(int row,
                    int column)
Parameters:
row - the row of the matrix.
column - the column of the matrix.
Returns:
the entry at the position (row, column) in the matrix.

getEntries

public int[][] getEntries()
Returns:
the adjacency matrix as a double integer array.


Copyright © 2012. All Rights Reserved.