public class Indexer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Indexer |
getAndUpdateIndexer(ArchetypeGraph g)
Gets the indexer associated with this graph.
|
static Indexer |
getAndUpdateIndexer(ArchetypeGraph g,
java.lang.Object key)
Gets the indexer associated with this graph.
|
int |
getIndex(ArchetypeVertex v)
Gets the index assocated with this vertex.
|
static Indexer |
getIndexer(ArchetypeGraph g)
Gets the indexer associated with this graph.
|
static Indexer |
getIndexer(ArchetypeGraph g,
java.lang.Object key)
* Gets an indexer associated with this graph at this key
|
ArchetypeVertex |
getVertex(int i)
Gets the vertex associated with this index.
|
static boolean |
hasIndexer(ArchetypeGraph g)
Checks if there is an indexer assocated with this graph.
|
static boolean |
hasIndexer(ArchetypeGraph g,
java.lang.Object key)
Checks if there is an indexer assocated with this graph.
|
static Indexer |
newIndexer(ArchetypeGraph g,
int offset)
Creates a new indexer associated with this graph.
|
void |
updateIndex()
Forces an index update, reindexing from zero.
|
void |
updateIndex(int offset)
Clears previous index (if it existed); puts in a new one.
|
public static Indexer getIndexer(ArchetypeGraph g)
FatalException
- if the graph has changed detectably since the last run. Note
that "has changed" merely looks at the number of nodes for
now.public static Indexer getAndUpdateIndexer(ArchetypeGraph g)
public static Indexer newIndexer(ArchetypeGraph g, int offset)
g
- the Graph to index.offset
- a starting value to index frompublic static Indexer getIndexer(ArchetypeGraph g, java.lang.Object key)
g
- The graph to checkkey
- The user data key to checkFatalException
- if the graph has changed detectably since the last run. Note
that "has changed" merely looks at the number of nodes for
now.public static Indexer getAndUpdateIndexer(ArchetypeGraph g, java.lang.Object key)
FatalException
- if the graph has changed detectably since the last run. Note
that "has changed" merely looks at the number of nodes for
now.public static boolean hasIndexer(ArchetypeGraph g)
g
- The graph to checkpublic static boolean hasIndexer(ArchetypeGraph g, java.lang.Object key)
g
- The graph to checkpublic void updateIndex(int offset)
offset
to offset + n - 1
(where n = g.numVertices()
),
and will be accessible through
getIndex( Vertex)
and getVertex( index )
.public void updateIndex()
updateIndex(0)
.public int getIndex(ArchetypeVertex v)
public ArchetypeVertex getVertex(int i)