de.cesr.more.util.io
Class MoreIoUtilities

java.lang.Object
  extended by de.cesr.more.util.io.MoreIoUtilities

public class MoreIoUtilities
extends Object

MORe Utility methods for writing and reading networks

Date:
05.10.2010

Constructor Summary
MoreIoUtilities()
           
 
Method Summary
static
<V,E extends MoreEdge<V>>
MoreNetwork<V,E>
inputNetwork(File inputfile, org.apache.commons.collections15.Factory<V> nodeFactory, MoreEdgeFactory<V,E> edgeFactory, String name)
          Reads a GraphML network from the given file into an directed MoreNetwork.
static
<V> MoreNetwork<V,MoreEdge<V>>
inputNetwork(File inputfile, org.apache.commons.collections15.Factory<V> nodeFactory, String name)
          Reads a GraphML network from the given file into an directed MoreNetwork.
static
<V,E extends MoreEdge<? super V>>
void
outputGraph(MoreNetwork<V,E> network, File outputFile)
          Write the given network to the given file in GraphML format.
static
<V,E extends MoreEdge<? super V>>
void
outputGraph(MoreNetwork<V,E> network, File outputFile, Map<String,GraphMLMetadata<V>> vertexMetadata, Map<String,GraphMLMetadata<E>> edgeMetadata)
           
static
<V,E extends MoreEdge<? super V>>
void
outputGraph(MoreNetwork<V,E> network, File outputFile, Map<String,GraphMLMetadata<V>> vertexMetadata, Map<String,GraphMLMetadata<E>> edgeMetadata, org.apache.commons.collections15.Transformer<V,String> vertexIdsTransformer)
          Allowed values for type in meta data: boolean, int, long, float, double, string Write the given network to the given file in GraphML format.
static
<V,E extends MoreEdge<? super V>>
void
outputGraph(MoreNetwork<V,E> network, File outputFile, org.apache.commons.collections15.Transformer<V,String> vertexIdsTransformer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoreIoUtilities

public MoreIoUtilities()
Method Detail

outputGraph

public static <V,E extends MoreEdge<? super V>> void outputGraph(MoreNetwork<V,E> network,
                                                                 File outputFile)
Write the given network to the given file in GraphML format.

Type Parameters:
V - vertex type parameter
E - edge type parameter
Parameters:
network - the network to write
outputFile - the file to write the network to

outputGraph

public static <V,E extends MoreEdge<? super V>> void outputGraph(MoreNetwork<V,E> network,
                                                                 File outputFile,
                                                                 org.apache.commons.collections15.Transformer<V,String> vertexIdsTransformer)

outputGraph

public static <V,E extends MoreEdge<? super V>> void outputGraph(MoreNetwork<V,E> network,
                                                                 File outputFile,
                                                                 Map<String,GraphMLMetadata<V>> vertexMetadata,
                                                                 Map<String,GraphMLMetadata<E>> edgeMetadata)
Parameters:
network -
outputFile -
vertexMetadata -
edgeMetadata -

outputGraph

public static <V,E extends MoreEdge<? super V>> void outputGraph(MoreNetwork<V,E> network,
                                                                 File outputFile,
                                                                 Map<String,GraphMLMetadata<V>> vertexMetadata,
                                                                 Map<String,GraphMLMetadata<E>> edgeMetadata,
                                                                 org.apache.commons.collections15.Transformer<V,String> vertexIdsTransformer)
Allowed values for type in meta data: boolean, int, long, float, double, string Write the given network to the given file in GraphML format.

Type Parameters:
V - vertex type parameter
E - edge type parameter
Parameters:
network - the network to write
outputFile - the file to write the network to
vertexMetadata - definition of meta-data for vertices
edgeMetadata - definition of meta-data for edges

inputNetwork

public static <V> MoreNetwork<V,MoreEdge<V>> inputNetwork(File inputfile,
                                                          org.apache.commons.collections15.Factory<V> nodeFactory,
                                                          String name)
Reads a GraphML network from the given file into an directed MoreNetwork.

Type Parameters:
V - vertex type parameter
Parameters:
inputfile - the file to read the network from
nodeFactory - the factory used to create new vertex objects
name - the new name of the network
Returns:
a directed MoreNetwork

inputNetwork

public static <V,E extends MoreEdge<V>> MoreNetwork<V,E> inputNetwork(File inputfile,
                                                                      org.apache.commons.collections15.Factory<V> nodeFactory,
                                                                      MoreEdgeFactory<V,E> edgeFactory,
                                                                      String name)
Reads a GraphML network from the given file into an directed MoreNetwork.

Type Parameters:
V - vertex type parameter
E - edge type parameter
Parameters:
inputfile - the file to read the network from
nodeFactory - the factory used to create new vertex objects
edgeFactory - the factory used to create new edge objects
name - the new name of the network
Returns:
a directed MoreNetwork