|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.graph.decorators.Indexer
public class Indexer
An Indexer applies an index to a Graph. The Indexer, specifically, attaches itself to a Graph's UserData and keeps a set of vertex keys as integers. An indexer can be used to look up both forward (Vertex - Index) and backward (Index - Vertex) . FIXME: note that there's currently no way to ask an Indexer instance what its offset is.
Method Summary | |
---|---|
static Indexer |
getAndUpdateIndexer(ArchetypeGraph g)
Gets the indexer associated with this graph. |
static Indexer |
getAndUpdateIndexer(ArchetypeGraph g,
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,
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,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 from
public static Indexer getIndexer(ArchetypeGraph g, Object key)
g
- The graph to checkkey
- The user data key to check
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, 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 check
public static boolean hasIndexer(ArchetypeGraph g, Object key)
g
- The graph to check
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |