mas.agentsHempelsSofa.data.graph
Class AdjacencyMatrix
java.lang.Object
mas.agentsHempelsSofa.data.graph.AdjacencyMatrix
public class AdjacencyMatrix
- extends java.lang.Object
Provides an adjacency matrix to represent a graph.
- Author:
- Hempels-Sofa
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AdjacencyMatrix
public AdjacencyMatrix(Graph g)
- Creates a new adjacency matrix of a given graph g.
- Parameters:
g
- - the given graph
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.