|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.io.PajekNetFile
PajekNetReader
and PajekNetWriter
public class PajekNetFile
A file reader for Pajek .net files. At the moment, only supports the part of the specification that defines:
Here is an example format for a directed graph without edge weights
and edges specified in list form:
*vertices <# of vertices> 1 "a" 2 "b" 3 "c" *arcslist 1 2 3 2 3Here is an example format for an undirected graph with edge weights and edges specified in non-list form:
*vertices <# of vertices> 1 "a" 2 "b" 3 "c" *edges 1 2 0.1 1 3 0.9 2 3 1.0
Field Summary | |
---|---|
static String |
EDGE_WEIGHT
Deprecated. |
Constructor Summary | |
---|---|
PajekNetFile()
Deprecated. Default constructor for pajek graph reader |
|
PajekNetFile(String[] edgeKeys)
Deprecated. Constructor which takes in the user datum keys for the edge weights |
Method Summary | |
---|---|
String[] |
getEdgeKeys()
Deprecated. retrieves the set of edge keys the algorithm will use to store the edge weights |
Graph |
load(Reader read)
Deprecated. Loads a graph for the given BufferedReader (where the data is assumed to be in Pajek NET format). |
Graph |
load(String filename)
Deprecated. Loads a graph from disk for the given .net file If the edges are directed then a directed graph will be created, otherwise an undirected graph will be created |
void |
save(Graph graph,
String filename)
Deprecated. Writes graph to the file specified by filename
in the Pajek NET format. |
void |
setCreateDirectedOnly(boolean createDirectedOnly)
Deprecated. Forces a graph that is normally undirected to be loaded in as its directed equivalent |
void |
setEdgeKeys(String[] edgeKeys)
Deprecated. set the edge the algorithm will use to store the edge weights |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EDGE_WEIGHT
Constructor Detail |
---|
public PajekNetFile()
public PajekNetFile(String[] edgeKeys)
edgeKeys
- the user datum keys the algorithm should use to store the edge weights (as MutableDoubles)Method Detail |
---|
public String[] getEdgeKeys()
public void setEdgeKeys(String[] edgeKeys)
edgeKeys
- the user datum keys the algorithm should use to store the edge weights (as MutableDoubles)public Graph load(String filename)
load
in interface GraphFile
filename
- the fully specified file name of the pajek .net file
public void setCreateDirectedOnly(boolean createDirectedOnly)
createDirectedOnly
- if true, force graph to be directed, false to not force this constraintpublic Graph load(Reader read)
read
- the data stream that contains the graph data in .net format
public void save(Graph graph, String filename)
graph
to the file specified by filename
in the Pajek NET format.
save
in interface GraphFile
graph
- the graph to savefilename
- the fully specified file name where the graph is to be saved to disk
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |