Class IntegerListImmutableGraph

All Implemented Interfaces:
FlyweightPrototype<ImmutableGraph>

public class IntegerListImmutableGraph
extends ImmutableSequentialGraph
Exposes a graph in a simple binary format as an (offline-only) ImmutableGraph.

This class is a simple example that should help in understanding how to interface WebGraph with external data. We have a graph contained in a file and represented by a list of binary 32-bit integers as follows: first we have the number of nodes, then the number of successors of node 0, then the list in increasing order of successors of node 0, then the number of successors of node 1, then the list in increasing order of successors of node 1, and so on.

If we want to transform this graph into, say, a BVGraph, we must create a class that exposes the file as an ImmutableGraph and than save it using BVGraph.store(ImmutableGraph,CharSequence) or by calling the main method of BVGraph. A complete implementation is not necessary, as BVGraph uses just nodeIterator(). Since we are just interesting in importing data, we do not implement efficient random access methods, and the only loading method we implement is loadOffline(CharSequence).