Package edu.ntnu.idatt1002.k2g05.models
Class Player
java.lang.Object
edu.ntnu.idatt1002.k2g05.models.Player
- All Implemented Interfaces:
Serializable
Class for holding a player in a competiton.
- See Also:
-
Constructor Details
-
Player
public Player(String name, char gender, char playerClass, String club, int license, double handicap, String country) Constructor for creating an instance of a player given his/her information.- Parameters:
name
- of the player, full name. Can not be blankgender
- of the player, must be 'M' for male of 'F' for femaleplayerClass
- class of the playerclub
- that the player is associated withlicense
- of the playerhandicap
- of the player, must be positive.country
- that the player is from- Throws:
IllegalArgumentException
- if arguments are not ut to par.NullPointerException
- if arguments are null.
-
-
Method Details
-
getName
-
getGender
public char getGender() -
getPlayerClass
public char getPlayerClass() -
getClub
-
getLicense
public int getLicense() -
getHandicap
public double getHandicap() -
getCountry
-
getInitials
Gets the initials of the player by spitting the name and getting every first character of the name.- Returns:
- the initials.
-
toString
-