java.lang.ObjectUzel
public class Uzel
Write a description of class Uzel here.
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 |
---|
public int mezX
public int mezY
Constructor Detail |
---|
public Uzel(int[][] ctverce)
ctverce
- Reference to an array of array (3*3). !Array must be actually created somewhere!public Uzel(int[][] ctverce, int mezX, int mezY)
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 |
---|
public int getH(int i)
i
- The number of heuristic
public int getH1()
public int getH2()
public boolean isFinal()
public boolean isPossible(Direction smer)
smer
- Direction in which we want to know if is it possible to go
public void setH(int i)
i
- Which heuristic will be chosenpublic void setH1()
public void setH2()
public Uzel syn(Direction smer)
smer
- Direction in which is the new son created.
public java.lang.String toString()
toString
in class java.lang.Object