Class NetData

java.lang.Object
  |
  +--NetData

public class NetData
extends java.lang.Object

Class for reading datasets from files. Every dataset is defined by a base name and consists of two files, basename-knoten.csv and basename-kanten.csv, respectively. Both files must be plain text files containing integer data seperated by semicolons. First line contains fieldnames and is skipped on reading the file.

Author:
Stefan Daschek

Field Summary
(package private)  java.util.HashMap edges
          HashMap holding edge-data.
(package private)  java.util.HashMap knots
          HashMap holding knot-data.
 
Constructor Summary
NetData(java.lang.String baseFileName)
          Read data from Files specified by baseFileName.
 
Method Summary
 Edge getEdge(int id)
          Return Edge object for edge with specified id.
 java.util.HashMap getEdges()
          Return HashMap holding edge data.
 Knot getKnot(int id)
          Return Knot object for knot with specified id.
 java.util.HashMap getKnots()
          Return HashMap holding knot data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

knots

java.util.HashMap knots
HashMap holding knot-data.


edges

java.util.HashMap edges
HashMap holding edge-data.

Constructor Detail

NetData

public NetData(java.lang.String baseFileName)
        throws java.io.FileNotFoundException,
               java.lang.NumberFormatException,
               java.util.NoSuchElementException,
               java.io.IOException
Read data from Files specified by baseFileName. Filenames are generated by appending "-knoten.csv" and "-kanten.cvs" to baseFileName, respectively.

Parameters:
baseFileName - Basename of files to read.
Throws:
java.io.FileNotFoundException - If any of the data files could not be found.
java.lang.NumberFormatException - If there is an error in any of the data files.
java.io.IOException - If there is a problem reading any of the data files.
java.util.NoSuchElementException
Method Detail

getKnots

public java.util.HashMap getKnots()
Return HashMap holding knot data.

Returns:
HashMap holding knot data.

getEdges

public java.util.HashMap getEdges()
Return HashMap holding edge data.

Returns:
HashMap holding edge data.

getKnot

public Knot getKnot(int id)
Return Knot object for knot with specified id.

Parameters:
id - ID of the knot.
Returns:
Knot object for knot with specified id.

getEdge

public Edge getEdge(int id)
Return Edge object for edge with specified id.

Parameters:
id - ID of the edge.
Returns:
Edge object for edge with specified id.