public class OptNode extends OptGraphable implements Node
Node
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
OptNode.RelatedIterator
An iterator used to iterate over related nodes.
|
Constructor and Description |
---|
OptNode()
Constructs a new OptimizedNode.
|
OptNode(int degree)
Constructs a new Optimized Node with a known degree.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Edge e)
Adds an edge to the adjacency list of the node.
|
int |
getDegree()
Returns the degree of the node.
|
Edge |
getEdge(Node other)
Returns an edge in the adjacency list of the node that is adjacent to another specified node.
|
Edge[] |
getEdgeArray()
Returns the edge adjacency list of the node as an array.
|
List |
getEdges()
Returns the edge adjacency list of the node.
|
List |
getEdges(Node other)
Returns a collection of edges in the adjacency list of the node that are adjacent to another
specified node.
|
Iterator |
getRelated()
This iterator iterates over the underlying edge array of the node.
|
void |
remove(Edge e)
Not supported.
|
void |
setDegree(int degree)
Sets the degree of the node.
|
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited
public OptNode()
public OptNode(int degree)
degree
- The degree of the node.public void add(Edge e)
Node
add
in interface Node
e
- Adjacent edge to add.Node.add(Edge)
public void remove(Edge e)
remove
in interface Node
e
- Adjacent edge to remove.UnsupportedOperationException
Node.remove(Edge)
public Edge getEdge(Node other)
Node
getEdge
in interface Node
other
- The other node that the desired edge to return is adjacent to.Node.getEdge(Node)
public List getEdges(Node other)
Node
getEdges
in interface Node
other
- The other node that the desired edges to return are adjacent to.Node.getEdges(Node)
public Edge[] getEdgeArray()
public List getEdges()
Node
getEdges
in interface Node
Node.getEdges()
public void setDegree(int degree)
degree
- The degree of the node / size of edge adjacency array.public int getDegree()
Node
getDegree
in interface Node
Node.getDegree()
public Iterator getRelated()
getRelated
in interface Graphable
Graphable.getRelated()
Copyright © 1996–2019 Geotools. All rights reserved.