uchicago.src.sim.network
Class DlReader

java.lang.Object
  extended by uchicago.src.sim.network.DlReader
All Implemented Interfaces:
NetworkMatrixReader

public class DlReader
extends java.lang.Object
implements NetworkMatrixReader

Matrix reader for UCINET dl format files. This will only read square matrices whose rows and columns refer to the same nodes.

Version:
$Revision: 1.5 $ $Date: 2004/11/03 19:51:00 $
Author:
Nick Collier

Constructor Summary
DlReader(java.io.InputStream stream)
          Creates a DlRedaer to read from the specified InputStream.
DlReader(java.lang.String filename)
          Creates a DlReader to read the specified file.
 
Method Summary
 void close()
          Closes the reader.
 java.util.Vector getMatrices()
          Deprecated. use getMatrices(int matrixType) instead.
 java.util.Vector getMatrices(int matrixType)
          Gets the matrix or matrices from the dl formatted file as a Vector of AdjancencyMatrices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DlReader

public DlReader(java.lang.String filename)
Creates a DlReader to read the specified file.

Parameters:
filename - the name of the file to read (in dl format)

DlReader

public DlReader(java.io.InputStream stream)
Creates a DlRedaer to read from the specified InputStream.

Parameters:
stream - the InputStream to read from.
Method Detail

getMatrices

public java.util.Vector getMatrices()
                             throws java.io.IOException
Deprecated. use getMatrices(int matrixType) instead.

Gets the matrix or matrices from the dl formatted file as a Vector of AdjancencyMatrices.

Specified by:
getMatrices in interface NetworkMatrixReader
Returns:
a Vector of AdjacencyMatrices.
Throws:
java.io.IOException

getMatrices

public java.util.Vector getMatrices(int matrixType)
                             throws java.io.IOException
Gets the matrix or matrices from the dl formatted file as a Vector of AdjancencyMatrices.

The matrixType parameter refers to the size of the matrix elements, the ij values. A matrix of type of NetworkConstants.BINARY contains on 0 or 1 as elements. A matrix of type of NetworkConstants.SMALL contains values of -127 - 127 as elements. And a matrix of type NetworkConstants.LARGE contains anything else. Choose the type appropriate to the values in the matrix you are importing.

Specified by:
getMatrices in interface NetworkMatrixReader
Parameters:
matrixType - the type of the matrix. type refers to the size of the matrix elements (ij values) and can be one of NetworkConstants.BINARY, NetworkConstants.LARGE, NetworkConstants.SMALL
Returns:
a Vector of AdjacencyMatrices.
Throws:
java.io.IOException

close

public void close()
Closes the reader.

Specified by:
close in interface NetworkMatrixReader