uk.me.jstott.sun
Class Time

java.lang.Object
  extended by uk.me.jstott.sun.Time

public class Time
extends java.lang.Object

Class to represent a time (hh:mm.ss) object. For more information on using this class, look at http://www.jstott.me.uk/jsuntimes/

Version:
0.1
Author:
Jonathan Stott

Constructor Summary
Time(int h, int m, double s)
          Create a time object
 
Method Summary
 int getHours()
           
 int getMinutes()
           
 double getSeconds()
           
 void setHours(int hours)
           
 void setMinutes(int minutes)
           
 void setRoundedSeconds(boolean r)
          Determines whether the seconds should be rounded to the nearest whole value when using the toString() method.
 void setSeconds(double seconds)
           
 java.lang.String toString()
          Return a String representation of the Time
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time(int h,
            int m,
            double s)
Create a time object

Parameters:
h - hours
m - minute
s - seconds
Method Detail

setRoundedSeconds

public void setRoundedSeconds(boolean r)
Determines whether the seconds should be rounded to the nearest whole value when using the toString() method.

Parameters:
r - true to cause seconds to be rounded

toString

public java.lang.String toString()
Return a String representation of the Time

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getHours

public int getHours()
Returns:
Returns the hours.

setHours

public void setHours(int hours)
Parameters:
hours - The hours to set.

getMinutes

public int getMinutes()
Returns:
Returns the minutes.

setMinutes

public void setMinutes(int minutes)
Parameters:
minutes - The minutes to set.

getSeconds

public double getSeconds()
Returns:
Returns the seconds.

setSeconds

public void setSeconds(double seconds)
Parameters:
seconds - The seconds to set.