|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectshady.common.pathfinder.Node
public class Node
Used in the graph representation the possible shady connection points in the environment.
Target: 1.4 JRE.
Copyright (C) 2006 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
| Field Summary | |
|---|---|
private static java.lang.String |
cvsid
CVS id. |
private double |
distanceToStartNode
Distance to start node. |
private java.util.LinkedList |
edges
All edges connected to this node. |
private java.util.LinkedList |
neighbours
Neighbour nodes to this node. |
private Node |
next
Next node in the path. |
private Point.OnSegment |
point
Point on a segment in the environment. |
private Node |
previous
Previous node in the path. |
| Constructor Summary | |
|---|---|
Node(Point.OnSegment point)
Create a new Node with reference to a 2D point. |
|
| Method Summary | |
|---|---|
protected void |
addEdge(Edge edge)
Adds an edge to the list of edges. |
protected void |
addNeighbour(Node node)
Adds a node to the list of neighbours. |
protected double |
getDistanceToStartNode()
Gets the distance to the start node. |
protected java.util.LinkedList |
getEdges()
Gets all edges that are assosiated with a node. |
protected Edge |
getEdgeWithEndNode(Node node)
Gets the edge that terminates at a given node. |
protected java.util.LinkedList |
getNeighbours()
Gets all neighbouring nodes, i.e syblings of a node. |
protected Node |
getNext()
Gets the reference to the next node in the path. |
Point.OnSegment |
getPoint()
Gets the point assosiated with this node. |
protected Node |
getPrevious()
Gets the reference to the previous node in the path. |
protected void |
setDistanceToStartNode(double distance)
Sets the distance to the start node. |
protected void |
setNext(Node node)
Sets the reference to the next node in the path. |
protected void |
setPrevious(Node node)
Sets the reference to the previous node in the path. |
java.lang.String |
toString()
returns point.toString() |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String cvsid
CVS id.
private Point.OnSegment point
Point on a segment in the environment.
private Node previous
Previous node in the path.
private Node next
Next node in the path.
private java.util.LinkedList neighbours
Neighbour nodes to this node.
private java.util.LinkedList edges
All edges connected to this node.
private double distanceToStartNode
Distance to start node.
| Constructor Detail |
|---|
public Node(Point.OnSegment point)
Create a new Node with reference to a 2D point. The node has a distance to the start node set as posistive infinity.
N.B! that each node also know which edges connects to and from it.
point - the corresponding 2D point| Method Detail |
|---|
protected double getDistanceToStartNode()
Gets the distance to the start node.
protected void setDistanceToStartNode(double distance)
Sets the distance to the start node.
distance - the distanceprotected Edge getEdgeWithEndNode(Node node)
Gets the edge that terminates at a given node.
node - the end node
protected Node getNext()
Gets the reference to the next node in the path.
protected void setNext(Node node)
Sets the reference to the next node in the path.
node - the reference to the next node in the pathprotected Node getPrevious()
Gets the reference to the previous node in the path.
protected void setPrevious(Node node)
Sets the reference to the previous node in the path.
node - the reference to the previous node in the pathprotected void addNeighbour(Node node)
Adds a node to the list of neighbours.
node - the node to addprotected java.util.LinkedList getNeighbours()
Gets all neighbouring nodes, i.e syblings of a node.
protected void addEdge(Edge edge)
Adds an edge to the list of edges.
edge - the edge to addprotected java.util.LinkedList getEdges()
Gets all edges that are assosiated with a node.
public Point.OnSegment getPoint()
Gets the point assosiated with this node.
public java.lang.String toString()
point.toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||