Class Skier

java.lang.Object
  extended bySkier

public class Skier
extends Object

This class models a skier using a CSE 142 ski resort.

Each Skier has several properties that are maintained by the methods of the object.


Constructor Summary
Skier(String skierName, char abilityLevel)
          Create a new skier object.
 
Method Summary
 void crash()
          The Trail has decided that we didn't make it down the slope.
 int getCrashCount()
          Get the current crash count of this skier.
 char getLevel()
          Get the ability level of this skier.
 String getName()
          Get the name of this skier.
 int getSwoopCount()
          Get the current swoop count of this skier.
 boolean isAtTop()
          Get the status of whether or not we are at the top of a Lift.
 void setAtTop(boolean top)
          Set the status of whether or not we are at the top of a Lift.
 void setLevel(char abilityLevel)
          Set the ability level of this skier.
 void swoop()
          We are swooping down a Trail, graceful as can be.
 String toString()
          Return a String describing this Skier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Skier

public Skier(String skierName,
             char abilityLevel)
Create a new skier object.

Parameters:
skierName - the name of this sportsperson
abilityLevel - the ability level, 'b', 'i', or 'a'
See Also:
Skier property descriptions
Method Detail

getName

public String getName()
Get the name of this skier.

Returns:
name of this sportsperson.

getLevel

public char getLevel()
Get the ability level of this skier.

Returns:
the one character ability level tag
See Also:
Skier property descriptions

setLevel

public void setLevel(char abilityLevel)
Set the ability level of this skier.

Parameters:
abilityLevel - the new one character ability level tag
See Also:
Skier property descriptions

setAtTop

public void setAtTop(boolean top)
Set the status of whether or not we are at the top of a Lift.

Parameters:
top - true if at top, false if at base

isAtTop

public boolean isAtTop()
Get the status of whether or not we are at the top of a Lift.

Returns:
true if at top, false if at base

swoop

public void swoop()
We are swooping down a Trail, graceful as can be. Increment this skier's swoop count by one. Print a message indicating that we are on our way.


crash

public void crash()
The Trail has decided that we didn't make it down the slope. Increment this skier's crash count by one. Print a message indicating that we crashed. (It would be nice to make a loud noise here, but that's a little hard on the rest of the people in the lab so we won't...)


getCrashCount

public int getCrashCount()
Get the current crash count of this skier.

Returns:
number of crashes

getSwoopCount

public int getSwoopCount()
Get the current swoop count of this skier.

Returns:
number of swoops down the mountain

toString

public String toString()
Return a String describing this Skier.

Returns:
string description of this skier