public class DocumentSequenceImmutableGraph extends ImmutableSequentialGraph
VirtualDocumentResolver
is used to associate node numbers to each fragment.
More precisely, the graph will have as many nodes as there are documents in the sequence, the k-th document (starting from 0) representing node number k. The successors of a document are obtained by extracting the virtual field from the document, turning each document specifier into a document number (using the given resolver, and discarding unresolved URLs).
ImmutableGraph.LoadMethodGRAPHCLASS_PROPERTY_KEY, PROPERTIES_EXTENSION| Constructor and Description |
|---|
DocumentSequenceImmutableGraph(DocumentSequence sequence,
int virtualField,
VirtualDocumentResolver resolver)
Creates an immutable graph from a sequence.
|
DocumentSequenceImmutableGraph(String... arg)
Creates a new immutable graph with the specified arguments.
|
| Modifier and Type | Method and Description |
|---|---|
ImmutableGraph |
copy() |
NodeIterator |
nodeIterator() |
int |
numNodes() |
boolean |
randomAccess() |
nodeIterator, outdegree, successorArraybasename, equals, hashCode, load, load, load, loadMapped, loadMapped, loadOffline, loadOffline, loadOnce, loadSequential, loadSequential, numArcs, outdegrees, store, store, successors, toStringpublic DocumentSequenceImmutableGraph(DocumentSequence sequence, int virtualField, VirtualDocumentResolver resolver)
sequence - the sequence whence the immutable graph should be created.virtualField - the number of the virtual field to be used to get the successors from.resolver - the resolver to be used to map document specs to node numbers.public DocumentSequenceImmutableGraph(String... arg) throws IOException, ClassNotFoundException
arg - a 3-element array: the first is the basename of a DocumentSequence, the second is an integer specifying the virtual
field number, the third is the basename of a VirtualDocumentResolver.IOExceptionClassNotFoundExceptionpublic ImmutableGraph copy()
copy in interface FlyweightPrototype<ImmutableGraph>copy in class ImmutableSequentialGraphpublic int numNodes()
numNodes in class ImmutableGraphpublic boolean randomAccess()
randomAccess in class ImmutableSequentialGraphpublic NodeIterator nodeIterator()
nodeIterator in class ImmutableGraph