org.jtheque.utils.bean
Class Duration

java.lang.Object
  extended by org.jtheque.utils.bean.Duration

public final class Duration
extends Object

This class represent a duration of time. A Duration is a period of hours and minutes.

Author:
Baptiste Wicht

Constructor Summary
Duration()
          Construct a new empty duration.
Duration(int minutes)
          Construct a new duration with only minutes.
 
Method Summary
 boolean equals(Object o)
           
 int getHours()
          Returns the hours of the duration.
 int getMinutes()
          Returns the minutes of the duration.
 int hashCode()
           
 void setHours(int hours)
          Set the hours of the duration.
 void setMinutes(int minutes)
          Set the minutes of the duration.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration(int minutes)
Construct a new duration with only minutes. If there is more than 60 minutes, we dispatch the time to the hours.

Parameters:
minutes - The minutes of the duration

Duration

public Duration()
Construct a new empty duration.

Method Detail

getHours

public int getHours()
Returns the hours of the duration.

Returns:
The number of hours in the duration

setHours

public void setHours(int hours)
Set the hours of the duration.

Parameters:
hours - The new number of hours in the duration

getMinutes

public int getMinutes()
Returns the minutes of the duration.

Returns:
The number of minutes in the duration

setMinutes

public void setMinutes(int minutes)
Set the minutes of the duration.

Parameters:
minutes - The new number of minutes

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010 JTheque. All Rights Reserved.