Package org.gephi.graph.api
Class GraphModel.Serialization
- java.lang.Object
-
- org.gephi.graph.api.GraphModel.Serialization
-
- Enclosing interface:
- GraphModel
public static class GraphModel.Serialization extends Object
Serialization utility to read/write graph models from/to input/output.
-
-
Constructor Summary
Constructors Constructor Description Serialization()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GraphModelread(DataInput input)Read theinputand return the read graph model.static GraphModelread(DataInput input, GraphModel graphModel)Read theinputinto the given graph model.static GraphModelreadWithoutVersionHeader(DataInput input, float graphStoreVersion)Read theinputand return the read graph model without an explicit version header in the input.static voidwrite(DataOutput output, GraphModel graphModel)WritegraphModeltooutput.
-
-
-
Method Detail
-
read
public static GraphModel read(DataInput input) throws IOException
Read theinputand return the read graph model.- Parameters:
input- data input to read from- Returns:
- new graph model
- Throws:
IOException- if an io error occurs
-
read
public static GraphModel read(DataInput input, GraphModel graphModel) throws IOException
Read theinputinto the given graph model. The provided graph model should be empty.- Parameters:
input- data input to read from- Returns:
- the graphmodel passed as parameter
- Throws:
IOException- if an io error occurs
-
readWithoutVersionHeader
public static GraphModel readWithoutVersionHeader(DataInput input, float graphStoreVersion) throws IOException
Read theinputand return the read graph model without an explicit version header in the input. To be used with old graphstore serialized data prior to version 0.4 (first, that added the version header).- Parameters:
input- data input to read fromgraphStoreVersion- Forced version to use- Returns:
- new graph model
- Throws:
IOException- if an io error occurs
-
write
public static void write(DataOutput output, GraphModel graphModel) throws IOException
WritegraphModeltooutput.- Parameters:
output- data output to write tographModel- graph model to write- Throws:
IOException- if an io error occurs
-
-