Class Uzel

java.lang.Object
  extended by Uzel

public class Uzel
extends java.lang.Object

Trida Uzel implementuje uzel binarniho vyhledavaciho stromu problemu kanibalu a misionaru

Version:
1.0 4.10.2006
Author:
Martin Řehánek

Constructor Summary
Uzel(byte misionari, byte kanibalove, boolean lod, Uzel predek)
           
 
Method Summary
 void generujSyny()
          Generates all posible sons (object of type Uzel) and stores references to them into the synove[]
 byte getKanibalove()
           
 boolean getLod()
           
 byte getMisionari()
           
 Uzel getPredek()
           
 Uzel getSyn(byte i)
           
 byte pocetSynu()
          Returns String representing the state
 java.lang.String toString()
          Returns String representing the state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Uzel

public Uzel(byte misionari,
            byte kanibalove,
            boolean lod,
            Uzel predek)
Parameters:
kanibalove - pocet kanibalu
misionari - pocet misionaru
lod - Pravda, pokud je lod na prvnim brehu
Method Detail

generujSyny

public void generujSyny()
Generates all posible sons (object of type Uzel) and stores references to them into the synove[]


getKanibalove

public byte getKanibalove()

getLod

public boolean getLod()

getMisionari

public byte getMisionari()

getPredek

public Uzel getPredek()

getSyn

public Uzel getSyn(byte i)

pocetSynu

public byte pocetSynu()
Returns String representing the state

Returns:
(number of cannibals, number of missionaries, 1 if the ship is on the first bank, 0 otherwise)

toString

public java.lang.String toString()
Returns String representing the state

Overrides:
toString in class java.lang.Object
Returns:
(number of cannibals, number of missionaries, 1 if the ship is on the first bank, 0 otherwise)