Hemisson
Tjerk Kostelijk & Anne Schuth
<-- BACK TO CLASSES

Class Node

java.lang.Object
  extended byNode

public class Node
extends java.lang.Object


Constructor Summary
Node()
          The no-arg constructor only declares the coordinates.
Node(int _iX, int _iY)
          Instantiates the coordinates of the Node.
Node(int _iX, int _iY, int _iTop, int _iRight, int _iBottom, int _iLeft)
          The full contructor, instantiates the coordinate and wall booleans on the four side's of the coordinate
Node(Node _nNode)
           
Node(Point _pPoint)
          Instantiates the coordinates of the Node.
Node(Point _pPoint, int _iTop, int _iRight, int _iBottom, int _iLeft)
          The full contructor, instantiates the coordinate and wall booleans on the four side's of the coordinate
 
Method Summary
 boolean allBordersKnown()
           
 int bordersFalseCount()
           
 int bordersUnknownCount()
           
 int borderValue(int _iDirection)
          Checks wheter a border exist at a given loaction
 int getBottom()
           
 double getF()
           
 int getG()
           
 int getH()
           
 int getLeft()
           
 Node getParent()
           
 int getRight()
           
 int getTop()
           
 int getX()
           
 int getY()
           
 boolean isPointEqual(Node _nNode)
          Checks wheter two Nodes have the same Coordinate
 void setBorder(int _iDirection, int _iValue)
          Sets the Wall yes or no at Top of gridcoordinate
 void setBottom(int _iBottom)
          Sets the Wall yes or no at Bottom of gridcoordinate
 void setG(int _iG)
          Sets the g(n) value
 void setH(int _iH)
          Sets the h(n) value
 void setLeft(int _iLeft)
          Sets the Wall yes or no at Left of gridcoordinate
 void setParent(Node _nNode)
          Sets the parent Node value
 void setRight(int _iRight)
          Sets the Wall yes or no at Right of gridcoordinate
 void setTop(int _iTop)
          Sets the Wall yes or no at Top of gridcoordinate
 void setX(int _iX)
          Sets the X coordinate
 void setY(int _iY)
          Sets the Y coordinate
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node()
The no-arg constructor only declares the coordinates.


Node

public Node(Node _nNode)

Node

public Node(Point _pPoint)
Instantiates the coordinates of the Node.

Parameters:
_pPoint - location of the gridcoordinate

Node

public Node(int _iX,
            int _iY)
Instantiates the coordinates of the Node.

Parameters:
_iX - the X value of the coordinate
_iY - the Y value of the coordinate

Node

public Node(Point _pPoint,
            int _iTop,
            int _iRight,
            int _iBottom,
            int _iLeft)
The full contructor, instantiates the coordinate and wall booleans on the four side's of the coordinate

Parameters:
_pPoint - location of the gridcoordinate
_iTop - Wall yes or no at Top of gridcoordinate
_iRight - Wall yes or no at Right of gridcoordinate
_iBottom - Wall yes or no at Bottom of gridcoordinate
_iLeft - Wall yes or no at Left of gridcoordinate

Node

public Node(int _iX,
            int _iY,
            int _iTop,
            int _iRight,
            int _iBottom,
            int _iLeft)
The full contructor, instantiates the coordinate and wall booleans on the four side's of the coordinate

Parameters:
_iX - the X value of the coordinate
_iY - the Y value of the coordinate
_iTop - Wall yes or no at Top of gridcoordinate
_iRight - Wall yes or no at Right of gridcoordinate
_iBottom - Wall yes or no at Bottom of gridcoordinate
_iLeft - Wall yes or no at Left of gridcoordinate
Method Detail

isPointEqual

public boolean isPointEqual(Node _nNode)
Checks wheter two Nodes have the same Coordinate

Parameters:
_nNode - The Node that the current Node is compared with
Returns:
true if the coordinates are the same

borderValue

public int borderValue(int _iDirection)
Checks wheter a border exist at a given loaction

Parameters:
_iDirection - The direction we are looking at (1=top,2=right,3=left,4=left)
Returns:
true if the border exists

allBordersKnown

public boolean allBordersKnown()

bordersUnknownCount

public int bordersUnknownCount()

bordersFalseCount

public int bordersFalseCount()

getX

public int getX()
Returns:
The integer X coordinate

getY

public int getY()
Returns:
The integer Y coordinate

getH

public int getH()
Returns:
The integer h(n) value

getG

public int getG()
Returns:
The integer g(n) value

getF

public double getF()
Returns:
The integer f(n) value

getTop

public int getTop()
Returns:
The int value containing a wall at Topside of the coordinaat

getRight

public int getRight()
Returns:
The int value containing a wall at Rightside of the coordinaat

getBottom

public int getBottom()
Returns:
The int value containing a wall at Bottomside of the coordinaat

getLeft

public int getLeft()
Returns:
The int value containing a wall at Leftside of the coordinaat

getParent

public Node getParent()
Returns:
The parent-Node

setX

public void setX(int _iX)
Sets the X coordinate

Parameters:
_iX - the X value of the coordinate

setY

public void setY(int _iY)
Sets the Y coordinate

Parameters:
_iY - the Y value of the coordinate

setBorder

public void setBorder(int _iDirection,
                      int _iValue)
Sets the Wall yes or no at Top of gridcoordinate


setTop

public void setTop(int _iTop)
Sets the Wall yes or no at Top of gridcoordinate

Parameters:
_iTop - Wall yes or no at Top of gridcoordinate

setRight

public void setRight(int _iRight)
Sets the Wall yes or no at Right of gridcoordinate

Parameters:
_iRight - Wall yes or no at Right of gr_iTopidcoordinate

setBottom

public void setBottom(int _iBottom)
Sets the Wall yes or no at Bottom of gridcoordinate

Parameters:
_iBottom - Wall yes or no at Bottom of gridcoordinate

setLeft

public void setLeft(int _iLeft)
Sets the Wall yes or no at Left of gridcoordinate

Parameters:
_iLeft - Wall yes or no at Left of gridcoordinate

setG

public void setG(int _iG)
Sets the g(n) value

Parameters:
_iG - g(n)

setH

public void setH(int _iH)
Sets the h(n) value

Parameters:
_iH - h(n)

setParent

public void setParent(Node _nNode)
Sets the parent Node value


toString

public java.lang.String toString()
Returns:
A String with the coordinates placed in brackets.

Hemisson
Tjerk Kostelijk & Anne Schuth
<-- BACK TO CLASSES