|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.core.CursorAdapter | +--gishur.graph.core.GraphCursor
The basic Cursor
class to traverse arbitrary Graphs
.
The class inherits the abstract methods of CursorAdapter
and does not
define them, so it is abstract. But there is further Graph
-specific
functionality defined, like direct access to Edges
and
Nodes
of the underlying Graph
and for the use of
Filters
to define special parts of sets of elements of
the underlying Graph
as valid positions.
Constructor Summary | |
GraphCursor()
|
Method Summary | |
void |
addFilter(Filter f)
Adds a Filter to the Filter -pipeline so that the
move of the Cursor will furthermore happen on only these elments
which are not filtered out by f and the other
registered Filters . |
Edge |
edge()
Returns the element under the actual position as an Edge ,
if this is possible (i.e. the position is valid and points to an
Edge . |
Filter |
filter()
Returns the first Filter in the Filter pipeline of
this GraphCursor . |
abstract Graph |
graph()
Returns the Graph , on which the Cursor works. |
GraphElement |
graphElement()
Returns the element under the actual position as an GraphElement ,
if this is possible (i.e. the position is valid and points to an
GraphElement . |
boolean |
isEdge()
Checks if the cursor points to an Edge at the moment. |
boolean |
isNode()
Checks if the cursor points to a Node at the moment. |
Node |
node()
Returns the element under the actual position as a Node ,
if this is possible (i.e. the position is valid and points to a
Node . |
void |
removeFilter(Filter f)
Removes f from the Filter pipeline of this
GraphCursor . |
void |
set(GraphElement e)
Sets the GraphCursor to a new start element.
|
protected boolean |
validElement(java.lang.Object obj)
Returns true , if the given Object is not filtered-out
by the Filter -pipeline. |
Methods inherited from class gishur.core.CursorAdapter |
bottom, getBookmark, hasMoreElements, next, next, nextElement, prev, prev, set, set, top |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gishur.core.Cursor |
element, invalidate, length, relative, valid |
Constructor Detail |
public GraphCursor()
Method Detail |
public abstract Graph graph()
Graph
, on which the Cursor
works.Graph
, on which the Cursor
works.public GraphElement graphElement()
GraphElement
,
if this is possible (i.e. the position is valid and points to an
GraphElement
.GraphElement
public Edge edge()
Edge
,
if this is possible (i.e. the position is valid and points to an
Edge
.Edge
public Node node()
Node
,
if this is possible (i.e. the position is valid and points to a
Node
.Node
public boolean isEdge()
Edge
at the moment.true
if the cursor is set to an Edge
,
false
otherwisepublic boolean isNode()
Node
at the moment.true
if the cursor is set to a Node
,
false
otherwisepublic void addFilter(Filter f)
Filter
to the Filter
-pipeline so that the
move of the Cursor
will furthermore happen on only these elments
which are not filtered out by f
and the other
registered Filters
. If f==null
nothing
happens and the method returns.f
- the new Filter
to add to the pipelinepublic void removeFilter(Filter f)
f
from the Filter
pipeline of this
GraphCursor
. If f==null
or f
is
not part of the Filter
pipe, the method returns
effectiveless.f
- the Filter
to removepublic Filter filter()
Filter
in the Filter
pipeline of
this
GraphCursor
.Filter
in the pipeprotected final boolean validElement(java.lang.Object obj)
true
, if the given Object is not filtered-out
by the Filter
-pipeline. This method is for internal use,
in order to build GraphCursors
, that use the
supported filter-pipeline.obj
- the Object
to be testedtrue
, if the given Object is not filtered-outpublic void set(GraphElement e)
GraphCursor
to a new start element.
This method should be overwritten properly. Otherwise a
GraphException
will be thrown.e
- the new GraphElement
to set the cursor to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |