|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.ints.AbstractIntIterator
it.unimi.dsi.webgraph.NodeIterator
it.unimi.dsi.webgraph.labelling.ArcLabelledNodeIterator
public abstract class ArcLabelledNodeIterator
An iterator returning nodes, their successors and labels on the arcs.
The purpose of this abstract implementation is to override covariantly
the return type of of NodeIterator.successors()
, so that
it has to be a ArcLabelledNodeIterator.LabelledArcIterator
, and provide a general
implementation of a new labelArray()
method that returns
the labels of the arcs going out of the current node as an array.
Nested Class Summary | |
---|---|
static interface |
ArcLabelledNodeIterator.LabelledArcIterator
An iterator returning successor and the labels of the arcs toward them. |
Constructor Summary | |
---|---|
ArcLabelledNodeIterator()
|
Method Summary | |
---|---|
Label[] |
labelArray()
Returns a reference to an array containing the labels of the arcs going out of the current node in the same order as the order in which the corresponding successors are returned by successors() . |
abstract ArcLabelledNodeIterator.LabelledArcIterator |
successors()
Returns a lazy iterator over the successors of the current node. |
protected static Label[] |
unwrap(ArcLabelledNodeIterator.LabelledArcIterator iterator,
int howMany)
Returns a new array of labels filled with exactly howMany labels from the given iterator. |
Methods inherited from class it.unimi.dsi.webgraph.NodeIterator |
---|
outdegree, successorArray |
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntIterator |
---|
next, nextInt, remove, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Iterator |
---|
hasNext |
Constructor Detail |
---|
public ArcLabelledNodeIterator()
Method Detail |
---|
public abstract ArcLabelledNodeIterator.LabelledArcIterator successors()
NodeIterator
This implementation just wraps the array returned by NodeIterator.successorArray()
.
successors
in class NodeIterator
public Label[] labelArray()
successors()
.
The returned array may contain more entries than the outdegree of the current node. However, only those with indices from 0 (inclusive) to the outdegree of the current node (exclusive) contain valid data.
This implementation just unwrap the iterator returned by successors()
and
writes in a newly allocated array copies of the labels returned by ArcLabelledNodeIterator.LabelledArcIterator.label()
.
protected static Label[] unwrap(ArcLabelledNodeIterator.LabelledArcIterator iterator, int howMany)
howMany
labels from the given iterator.
Note that the iterator is required to have at least as many labels as needed.
iterator
- the iterator.howMany
- the number of labels.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |