|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.webgraph.ImmutableGraph
it.unimi.dsi.webgraph.labelling.ArcLabelledImmutableGraph
it.unimi.dsi.webgraph.labelling.ArcRelabelledImmutableGraph
public class ArcRelabelledImmutableGraph
Exhibits an arc-labelled immutable graph as another arc-labelled immutable graph changing only the kind of labels. Labels of the source graphs are mapped to labels of the exhibited graph via a suitable strategy provided at construction time.
Nested Class Summary | |
---|---|
static interface |
ArcRelabelledImmutableGraph.LabelConversionStrategy
A way to convert a label into another label. |
Nested classes/interfaces inherited from class it.unimi.dsi.webgraph.ImmutableGraph |
---|
ImmutableGraph.LoadMethod |
Field Summary | |
---|---|
static ArcRelabelledImmutableGraph.LabelConversionStrategy |
INT_LABEL_CONVERSION_STRATEGY
A conversion strategy that converts between any two classes extending AbstractIntLabel . |
Fields inherited from class it.unimi.dsi.webgraph.labelling.ArcLabelledImmutableGraph |
---|
UNDERLYINGGRAPH_PROPERTY_KEY, UNDERLYINGGRAPH_SUFFIX |
Fields inherited from class it.unimi.dsi.webgraph.ImmutableGraph |
---|
GRAPHCLASS_PROPERTY_KEY, PROPERTIES_EXTENSION |
Constructor Summary | |
---|---|
ArcRelabelledImmutableGraph(ArcLabelledImmutableGraph wrappedGraph,
Label newLabelPrototype,
ArcRelabelledImmutableGraph.LabelConversionStrategy conversionStrategy)
Creates a relabelled graph with given label prototype. |
Method Summary | |
---|---|
ArcRelabelledImmutableGraph |
copy()
Returns a flyweight copy of this immutable graph. |
static void |
main(String[] arg)
|
ArcLabelledNodeIterator |
nodeIterator(int from)
Returns a node iterator for scanning the graph sequentially, starting from the given node. |
int |
numNodes()
Returns the number of nodes of this graph. |
int |
outdegree(int x)
Returns the outdegree of a node. |
Label |
prototype()
Returns a prototype of the labels used by this graph. |
boolean |
randomAccess()
Checks whether this graph provides random access to successor lists. |
ArcLabelledNodeIterator.LabelledArcIterator |
successors(int x)
Returns a lazy iterator over the successors of a given node. |
Methods inherited from class it.unimi.dsi.webgraph.labelling.ArcLabelledImmutableGraph |
---|
equals, labelArray, load, load, loadOffline, loadOffline, loadOnce, loadSequential, loadSequential, nodeIterator, toString |
Methods inherited from class it.unimi.dsi.webgraph.ImmutableGraph |
---|
basename, hashCode, load, loadMapped, loadMapped, numArcs, outdegrees, store, store, successorArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ArcRelabelledImmutableGraph.LabelConversionStrategy INT_LABEL_CONVERSION_STRATEGY
AbstractIntLabel
.
Constructor Detail |
---|
public ArcRelabelledImmutableGraph(ArcLabelledImmutableGraph wrappedGraph, Label newLabelPrototype, ArcRelabelledImmutableGraph.LabelConversionStrategy conversionStrategy)
wrappedGraph
- the graph we are going to relabel.newLabelPrototype
- the prototype for the new type of labels.conversionStrategy
- the strategy to convert the labels of the wrapped graph into the new labels.Method Detail |
---|
public ArcRelabelledImmutableGraph copy()
ImmutableGraph
copy
in interface FlyweightPrototype<ImmutableGraph>
copy
in class ArcLabelledImmutableGraph
FlyweightPrototype
public ArcLabelledNodeIterator nodeIterator(int from)
ArcLabelledImmutableGraph
This implementation strengthens that provided in ImmutableGraph
, but
calls the labelled random-access method ArcLabelledImmutableGraph.successors(int)
.
nodeIterator
in class ArcLabelledImmutableGraph
from
- the node from which the iterator will iterate.
ArcLabelledNodeIterator
for accessing nodes, successors and their labels sequentially.ImmutableGraph.nodeIterator()
public ArcLabelledNodeIterator.LabelledArcIterator successors(int x)
ImmutableGraph
This implementation just wraps the array returned by ImmutableGraph.successorArray(int)
. Subclasses
are encouraged to override this implementation.
The semantics of this method has been significantly modified in WebGraph 2.0 to take advantage of the new, faster lazy architecture.
successors
in class ArcLabelledImmutableGraph
x
- a node.
public Label prototype()
ArcLabelledImmutableGraph
prototype
in class ArcLabelledImmutableGraph
public int numNodes()
ImmutableGraph
Albeit this method is not optional, it is allowed that this method throws
an UnsupportedOperationException
if this graph has never been entirely
traversed using a node iterator
. This apparently bizarre
behaviour is necessary to support implementations as ArcListASCIIGraph
, which
do not know the actual number of nodes until a traversal has been completed.
numNodes
in class ImmutableGraph
public boolean randomAccess()
ImmutableGraph
randomAccess
in class ImmutableGraph
public int outdegree(int x)
ImmutableGraph
outdegree
in class ImmutableGraph
x
- a node.
public static void main(String[] arg) throws JSAPException, IOException, IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException, InstantiationException
JSAPException
IOException
IllegalArgumentException
SecurityException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
ClassNotFoundException
InstantiationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |