nog
Class Participant

java.lang.Object
  |
  +--nog.Participant

public class Participant
extends java.lang.Object

This class contains information about one participant.


Constructor Summary
Participant()
          Default constructor of Participant.
Participant(java.lang.String s)
          Constructor of Participant with one single String.
Participant(java.lang.String id, java.lang.String name, java.lang.String country, java.lang.String sex, java.lang.String date, java.lang.String height, java.lang.String weight, java.lang.String sport)
          Constructor of Participant.
 
Method Summary
 int getCnt()
          Returns the number of participants.
 java.lang.String getCountry()
          Returns the country of the participant.
 java.lang.Double getHeight()
          Returns the height of the participant.
 int getId()
          Returns the Participants id.
 char getSex()
          Returns the sex of the participant.
 java.lang.String getSport()
          Returns the sport of the participant.
 java.lang.Double getWeight()
          Returns the weight of the participant.
 boolean is_num(java.lang.String s)
          Test if a String contains a number.
 boolean set_all(java.lang.String id, java.lang.String name, java.lang.String sex, java.lang.String country, java.lang.String date, java.lang.String height, java.lang.String weight, java.lang.String sport)
          Set all data of an Participant.
 java.lang.String toString()
          Creats a single String of a Participants attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Participant

public Participant()
Default constructor of Participant.

Participant

public Participant(java.lang.String id,
                   java.lang.String name,
                   java.lang.String country,
                   java.lang.String sex,
                   java.lang.String date,
                   java.lang.String height,
                   java.lang.String weight,
                   java.lang.String sport)
            throws PartException
Constructor of Participant.
Parameters:
id - the id of the participant.
name - the name of the participant.
contry - the contry where the participnat lives.
sex - male(M) or female(F).
date - the date when borned(1999/12/31).
height - the lenght of the participant.
weight - the weight of the participant.
sport - the sport the participant is participating in.

Participant

public Participant(java.lang.String s)
            throws PartException
Constructor of Participant with one single String.
Parameters:
s - a String with all info(id, name, country, sex, date, height, weight, sport).
Method Detail

is_num

public boolean is_num(java.lang.String s)
Test if a String contains a number.
Parameters:
s - the String to test.
Returns:
true if a number is within the String, false if not.

set_all

public boolean set_all(java.lang.String id,
                       java.lang.String name,
                       java.lang.String sex,
                       java.lang.String country,
                       java.lang.String date,
                       java.lang.String height,
                       java.lang.String weight,
                       java.lang.String sport)
                throws PartException
Set all data of an Participant.
Parameters:
id - the id of the participant.
name - the name of the participant.
sex - male(M) or female(F).
contry - the contry where the participnat lives.
date - the date when borned(1999/12/31).
height - the lenght of the participant.
weight - the weight of the participant.
sport - the sport the participant is participating in.
Returns:
true if stored, false if something got wrong.
Throws:
PartException -  

toString

public java.lang.String toString()
Creats a single String of a Participants attributes.
Overrides:
toString in class java.lang.Object
Returns:
the String with all info about the Participant.

getId

public int getId()
Returns the Participants id.
Returns:
the participants id.

getCnt

public int getCnt()
Returns the number of participants.
Returns:
the number of participants.

getWeight

public java.lang.Double getWeight()
Returns the weight of the participant.
Returns:
the weight of the participant.

getHeight

public java.lang.Double getHeight()
Returns the height of the participant.
Returns:
the height of the participant.

getSex

public char getSex()
Returns the sex of the participant.
Returns:
the sex of the participant.

getSport

public java.lang.String getSport()
Returns the sport of the participant.
Returns:
the sport of the participant.

getCountry

public java.lang.String getCountry()
Returns the country of the participant.
Returns:
the country of the participant.