org.geotools.graph.structure
Interface Graphable

All Known Subinterfaces:
DirectedEdge, DirectedGraphable, DirectedNode, Edge, Node, XYNode
All Known Implementing Classes:
BasicDirectedEdge, BasicDirectedNode, BasicDirectedXYNode, BasicEdge, BasicGraphable, BasicNode, BasicXYNode, DelaunayEdge, DelaunayNode, OptDirectedEdge, OptDirectedNode, OptDirectedXYNode, OptEdge, OptGraphable, OptNode, OptXYNode

public interface Graphable

Represents a component of a graph. Graph components model "real life" entities. These entities are represented by an underyling object reference.

Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
See Also:
Graph
Module:
modules/extension/graph (gt-graph.jar)

Method Summary
 int getCount()
          Returns the value of the counter for the component.
 int getID()
          Returns an identifier for the component.
 Object getObject()
          Returns the underlying object referenced by the graph component.
 Iterator getRelated()
          Returns an iterator over any related components.
 boolean isVisited()
          Determines if the component has been marked as visited.
 void setCount(int count)
          Sets the value of the counter for the component.
 void setID(int id)
          Sets the identifying integer for the component.
 void setObject(Object obj)
          Sets the underlying object reference for the component.
 void setVisited(boolean visited)
          Marks the component as being visited/unvisited.
 

Method Detail

getID

int getID()
Returns an identifier for the component. This number is not necessarily persistent or unique.

Returns:
Identifying integer.

setID

void setID(int id)
Sets the identifying integer for the component.

Parameters:
id - New identifying integer.

isVisited

boolean isVisited()
Determines if the component has been marked as visited. The visited flag serves as a binary switch for the component which can be used for graph queries, graph traversals, or user defined purposes.

Returns:
True if visited(on), false if unvisited(off).

setVisited

void setVisited(boolean visited)
Marks the component as being visited/unvisited. The visited flag serves as a binary switch for the component which can be used for graph queries, graph traversals, or user defined purposes.

Parameters:
visited - True if visited(on), false if unvisited(off).

getCount

int getCount()
Returns the value of the counter for the component. Graph components have a counter associated with them to be used for graph queries, graph traversals, or user defined purposes.

Returns:
int The value of the counter for the component.

setCount

void setCount(int count)
Sets the value of the counter for the component. Graph components have a counter associated with them to be used for graph queries, graph traversals, or user defined purposes.

Parameters:
count - The new value of the counter for the component.

getObject

Object getObject()
Returns the underlying object referenced by the graph component.

Returns:
Underlying object reference, the entity being modelled by graph component.

setObject

void setObject(Object obj)
Sets the underlying object reference for the component.

Parameters:
obj - The entity being modelled by the graph component.

getRelated

Iterator getRelated()
Returns an iterator over any related components. A graph component is related to other components of the graph of similary type through some relationship.

Returns:
Iterator An iterator over other components of the graph that are related to the component.


Copyright © 1996-2009 Geotools. All Rights Reserved.