Class Uzel

java.lang.Object
  extended by Uzel

public class Uzel
extends java.lang.Object

Write a description of class Uzel here.

Version:
(a version number or a date)
Author:
(your name)

Field Summary
 int mezX
           
 int mezY
           
 
Constructor Summary
Uzel(int[][] ctverce)
          Constructor for objects of class Uzel
Uzel(int[][] ctverce, int mezX, int mezY)
          Constructor for objects of class Uzel
 
Method Summary
 int getH(int i)
          Returns value of h1 or h2
 int getH1()
          Returns h1
 int getH2()
          Returns h2
 boolean isFinal()
          Returns true if the ctverce[][] of the are the same as spravnePole[][] (Not same objects but same values)
 boolean isPossible(Direction smer)
          Returns whether is it possible to go in specified direction
 void setH(int i)
          Calls one of two heuristics
 void setH1()
          Runs the first heuristik and sets variable h1
 void setH2()
          Runs the second heuristik and sets variable h2
 Uzel syn(Direction smer)
          Returns new son that originates from father by moving the space in specified direction
 java.lang.String toString()
          String representing setting of the board
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mezX

public int mezX

mezY

public int mezY
Constructor Detail

Uzel

public Uzel(int[][] ctverce)
Constructor for objects of class Uzel

Parameters:
ctverce - Reference to an array of array (3*3). !Array must be actually created somewhere!

Uzel

public Uzel(int[][] ctverce,
            int mezX,
            int mezY)
Constructor for objects of class Uzel

Parameters:
ctverce - Reference to an array of array (3*3). !Array must be actually created somewhere!
mezX - X coordinate of the "space"
mezX - Y coordinate of the "space"
Method Detail

getH

public int getH(int i)
Returns value of h1 or h2

Parameters:
i - The number of heuristic
Returns:
Value of h1 or h2 according to the paramether

getH1

public int getH1()
Returns h1

Returns:
h1

getH2

public int getH2()
Returns h2

Returns:
h2

isFinal

public boolean isFinal()
Returns true if the ctverce[][] of the are the same as spravnePole[][] (Not same objects but same values)

Returns:
true if the ctverce[][] of the are the same as spravnePole[][]

isPossible

public boolean isPossible(Direction smer)
Returns whether is it possible to go in specified direction

Parameters:
smer - Direction in which we want to know if is it possible to go
Returns:
True if it is possible to go in specified direction

setH

public void setH(int i)
Calls one of two heuristics

Parameters:
i - Which heuristic will be chosen

setH1

public void setH1()
Runs the first heuristik and sets variable h1


setH2

public void setH2()
Runs the second heuristik and sets variable h2


syn

public Uzel syn(Direction smer)
Returns new son that originates from father by moving the space in specified direction

Parameters:
smer - Direction in which is the new son created.
Returns:
New created son.

toString

public java.lang.String toString()
String representing setting of the board

Overrides:
toString in class java.lang.Object
Returns:
Grid with setting of the board