cz.muni.fi.pb162.school
Class StudentImpl

java.lang.Object
  extended by cz.muni.fi.pb162.school.StudentImpl
All Implemented Interfaces:
Student

public class StudentImpl
extends Object
implements Student

Tato třída implementuje rozhraní Student a reprezentuje studenta.

Author:
Petr Adamek <xadamek2@fi.muni.cz>

Constructor Summary
StudentImpl(int id, String name)
          Vytvoří novou instanci třídy student s daným identifikátorem a jménem.
 
Method Summary
 boolean equals(Object obj)
          Zjišťuje, zdali je objekt obj stejným studentem.
 int getId()
          Vrátí identifikátor studenta
 String getName()
          Vrátí jméno studenta
 int hashCode()
          Vrací hashovací kód studenta.
 String toString()
          Vrací řetězec s informacemi o studentovi.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StudentImpl

public StudentImpl(int id,
                   String name)
Vytvoří novou instanci třídy student s daným identifikátorem a jménem.

Parameters:
id - identifikátor vytvářeného studenta
name - jméno vytvářeného studenta
Method Detail

getName

public String getName()
Vrátí jméno studenta

Specified by:
getName in interface Student
Returns:
jméno studenta

getId

public int getId()
Vrátí identifikátor studenta

Specified by:
getId in interface Student
Returns:
identifikátor studenta

equals

public boolean equals(Object obj)
Zjišťuje, zdali je objekt obj stejným studentem.

Specified by:
equals in interface Student
Overrides:
equals in class Object
Parameters:
obj - Objekt, se kterým se bude tento student porovnávat
Returns:
true, pokud je obj stejný student jako tento

hashCode

public int hashCode()
Vrací hashovací kód studenta.

Specified by:
hashCode in interface Student
Overrides:
hashCode in class Object
Returns:
hashovací kód studenta

toString

public String toString()
Vrací řetězec s informacemi o studentovi.

Overrides:
toString in class Object
Returns:
hashovací kód studenta