Package com.mastfrog.graph
Interface StringGraph
-
- All Superinterfaces:
ObjectGraph<String>
public interface StringGraph extends ObjectGraph<String>
- Author:
- Tim Boudreau
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static StringGraphcreate(IntGraph graph, String[] sortedArray)Create a graph from the passed bit set graph, and a pre-sorted array of unique strings where integer nodes in the passed graph correspond to offsets within the array.static StringGraphload(ObjectInput in)voidsave(ObjectOutput out)Optimized serialization support.-
Methods inherited from interface com.mastfrog.graph.ObjectGraph
apply, bottomLevelNodes, byClosureSize, byReverseClosureSize, children, closureOf, closureSize, disjunctionOfClosureOfHighestRankedNodes, distance, edgeStrings, eigenvectorCentrality, inboundReferenceCount, isUnreferenced, outboundReferenceCount, pageRank, parents, pathsBetween, reverseClosureOf, reverseClosureSize, toNode, toNodeId, topLevelOrOrphanNodes, walk, walk, walkUpwards
-
-
-
-
Method Detail
-
create
static StringGraph create(IntGraph graph, String[] sortedArray)
Create a graph from the passed bit set graph, and a pre-sorted array of unique strings where integer nodes in the passed graph correspond to offsets within the array. The array must be sorted, not have duplicates, and have a matching number of elements for the unique node ids in the tree. If assertions are on, asserts will check that these invariants hold.- Parameters:
graph- A graphsortedArray- An array of strings matching the requirements stated above- Returns:
- A graph of strings which wraps the original graph
-
save
void save(ObjectOutput out) throws IOException
Optimized serialization support.- Specified by:
savein interfaceObjectGraph<String>- Parameters:
out- The output- Throws:
IOException- If something goes wrong
-
load
static StringGraph load(ObjectInput in) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
-