|
|||||||||
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.ImmutableSequentialGraph
public abstract class ImmutableSequentialGraph
An abstract immutable graph that throws an UnsupportedOperationException
on all random-access methods.
The main purpose of this class is to be used as a base for the numerous anonymous
classes that do not support random access. Note that we override ImmutableGraph
's
implementation of nodeIterator(int)
: here we just call
ImmutableGraph.nodeIterator()
and skip to the desired node. This makes nodeIterator()
and nodeIterator(0)
equivalent, which is usually what you want.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class it.unimi.dsi.webgraph.ImmutableGraph |
---|
ImmutableGraph.LoadMethod |
Field Summary |
---|
Fields inherited from class it.unimi.dsi.webgraph.ImmutableGraph |
---|
GRAPHCLASS_PROPERTY_KEY, PROPERTIES_EXTENSION |
Constructor Summary | |
---|---|
ImmutableSequentialGraph()
|
Method Summary | |
---|---|
ImmutableGraph |
copy()
Throws an UnsupportedOperationException . |
NodeIterator |
nodeIterator(int from)
Returns a node iterator for scanning the graph sequentially, starting from the given node. |
int |
outdegree(int x)
Throws an UnsupportedOperationException . |
boolean |
randomAccess()
Returns false. |
int[] |
successorArray(int x)
Throws an UnsupportedOperationException . |
Methods inherited from class it.unimi.dsi.webgraph.ImmutableGraph |
---|
basename, equals, hashCode, load, load, load, loadMapped, loadMapped, loadOffline, loadOffline, loadOnce, loadSequential, loadSequential, nodeIterator, numArcs, numNodes, outdegrees, store, store, successors, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ImmutableSequentialGraph()
Method Detail |
---|
public int[] successorArray(int x)
UnsupportedOperationException
.
successorArray
in class ImmutableGraph
x
- a node.
public int outdegree(int x)
UnsupportedOperationException
.
outdegree
in class ImmutableGraph
x
- a node.
public boolean randomAccess()
randomAccess
in class ImmutableGraph
public NodeIterator nodeIterator(int from)
ImmutableGraph
This implementation just calls the random-access methods (ImmutableGraph.successors(int)
and
ImmutableGraph.outdegree(int)
). More specific implementations may choose to maintain some extra state
to make the enumeration more efficient.
nodeIterator
in class ImmutableGraph
from
- the node from which the iterator will iterate.
NodeIterator
for accessing nodes and successors sequentially.public ImmutableGraph copy()
UnsupportedOperationException
.
copy
in interface FlyweightPrototype<ImmutableGraph>
copy
in class ImmutableGraph
FlyweightPrototype
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |