Package org.geotools.graph.structure.opt
Class OptGraphable
- Object
-
- OptGraphable
-
- All Implemented Interfaces:
Serializable,Graphable
- Direct Known Subclasses:
OptDirectedEdge,OptDirectedNode,OptEdge,OptNode
public abstract class OptGraphable extends Object implements Graphable, Serializable
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:
Graphable, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OptGraphable()Constructs a new optimized graphable object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount()Returns the value of the counter for the component.intgetID()Returns 0.ObjectgetObject()Returns null.booleanisVisited()Determines if the component has been marked as visited.voidsetCount(int count)To minimize space, the counter is stored as a byte.voidsetID(int id)Does nothing.voidsetObject(Object obj)Does nothing.voidsetVisited(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
-
-
-
-
Method Detail
-
setID
public void setID(int id)
Does nothing.- Specified by:
setIDin interfaceGraphable- Parameters:
id- New identifying integer.- See Also:
Graphable.setID(int)
-
getID
public int getID()
Returns 0.- Specified by:
getIDin interfaceGraphable- Returns:
- Identifying integer.
- See Also:
Graphable.getID()
-
setVisited
public void setVisited(boolean visited)
Description copied from interface:GraphableMarks 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:
setVisitedin interfaceGraphable- Parameters:
visited- True if visited(on), false if unvisited(off).- See Also:
Graphable.setVisited(boolean)
-
isVisited
public boolean isVisited()
Description copied from interface:GraphableDetermines 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.- Specified by:
isVisitedin interfaceGraphable- Returns:
- True if visited(on), false if unvisited(off).
- See Also:
Graphable.isVisited()
-
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.- Specified by:
setCountin interfaceGraphable- Parameters:
count- The new value of the counter for the component.- See Also:
Graphable.setCount(int)
-
getCount
public int getCount()
Description copied from interface:GraphableReturns 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.- Specified by:
getCountin interfaceGraphable- Returns:
- int The value of the counter for the component.
- See Also:
Graphable.getCount()
-
setObject
public void setObject(Object obj)
Does nothing.- Specified by:
setObjectin interfaceGraphable- Parameters:
obj- The entity being modelled by the graph component.- See Also:
Graphable.setObject(Object)
-
getObject
public Object getObject()
Returns null.- Specified by:
getObjectin interfaceGraphable- Returns:
- Underlying object reference, the entity being modelled by graph component.
- See Also:
Graphable.getObject()
-
-