public class EdgeData extends DistanceTable
| Constructor and Description |
|---|
EdgeData(int size,
EdgeDataFormat format)
Constructs a new, empty graph with no edges.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDistanceBetween(int id1,
int id2)
Returns the distance between the two specified nodes.
|
List<Edge> |
getEdges()
Returns the edges contained in this graph.
|
int[] |
getNeighborsOf(int id)
Returns the identifiers of all neighbors of the specified node.
|
int[] |
listNodes()
Returns the identifiers of all nodes in this distance table.
|
void |
load(BufferedReader reader)
Loads the distance table from the specified reader.
|
isNeighborpublic EdgeData(int size,
EdgeDataFormat format)
size - the number of nodes represented in this graphformat - the format of the edge data sectionpublic void load(BufferedReader reader) throws IOException
DistanceTableload in class DistanceTablereader - the reader containing the distance tableIOException - if an I/O error occurred while reading the distance
tablepublic List<Edge> getEdges()
public int[] listNodes()
DistanceTablelistNodes in class DistanceTablepublic int[] getNeighborsOf(int id)
DistanceTablegetNeighborsOf in class DistanceTableid - the identifier of the node whose neighbors are enumeratedpublic double getDistanceBetween(int id1,
int id2)
1 when an edge exists, or
Double.POSITIVE_INFINITY when no such edge exists.getDistanceBetween in class DistanceTableid1 - the identifier of the first nodeid2 - the identifier of the second nodeCopyright © 2016. All rights reserved.