Package org.geotools.graph.structure.opt
Class OptGraphable
Object
OptGraphable
- All Implemented Interfaces:
Serializable
,Graphable
- Direct Known Subclasses:
OptDirectedEdge
,OptDirectedNode
,OptEdge
,OptNode
Root of class hierarchy for optimized implementation of graph components. The optimizations reduce the space taken up
by graph components:
- Counter implemented as byte
- No underlying object reference.
- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
Returns the value of the counter for the component.int
getID()
Returns 0.Returns null.boolean
Determines if the component has been marked as visited.void
setCount
(int count) To minimize space, the counter is stored as a byte.void
setID
(int id) Does nothing.void
Does nothing.void
setVisited
(boolean visited) Marks the component as being visited/unvisited.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface Graphable
getRelated
-
Constructor Details
-
OptGraphable
public OptGraphable()Constructs a new optimized graphable object. Visited flag it set to false and counter set to -1.
-
-
Method Details
-
setID
public void setID(int id) Does nothing. -
getID
public int getID()Returns 0. -
setVisited
public void setVisited(boolean visited) Description copied from interface:Graphable
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.- Specified by:
setVisited
in interfaceGraphable
- Parameters:
visited
- True if visited(on), false if unvisited(off).- See Also:
-
isVisited
public boolean isVisited()Description copied from interface:Graphable
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. -
setCount
public void setCount(int count) To minimize space, the counter is stored as a byte. Therefore the counter can take on values from -128 to 127. -
getCount
public int getCount()Description copied from interface:Graphable
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. -
setObject
Does nothing. -
getObject
Returns null.
-