ccc.api.types
Class Duration

java.lang.Object
  extended by ccc.api.types.Duration
All Implemented Interfaces:
java.io.Serializable

public final class Duration
extends java.lang.Object
implements java.io.Serializable

A finite period of time.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Constructor Summary
Duration()
          Constructor.
Duration(long time)
          Constructor.
Duration(long days, long hours, long minutes, long seconds)
          Constructor.
 
Method Summary
 long dayField()
          Accessor for the day field.
 boolean equals(java.lang.Object obj)
          
 long getTime()
          Accessor.
 int hashCode()
          
 long hourField()
          Accessor for the hour field.
 long minuteField()
          Accessor for the minute field.
 long secondField()
          Accessor for the second field.
 void setTime(long time)
          Mutator.
 long time()
          Accessor for the time.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Duration

public Duration()
Constructor.


Duration

public Duration(long days,
                long hours,
                long minutes,
                long seconds)
Constructor.

Parameters:
days - Number of days
hours - Number of hours
minutes - Number of minutes
seconds - Number of seconds

Duration

public Duration(long time)
Constructor.

Parameters:
time - Time in seconds.
Method Detail

time

public long time()
Accessor for the time.

Returns:
Time in seconds.

getTime

public long getTime()
Accessor.

Returns:
Returns the time.

setTime

public void setTime(long time)
Mutator.

Parameters:
time - The time to set.

secondField

public long secondField()
Accessor for the second field.

Returns:
Value of the second field.

minuteField

public long minuteField()
Accessor for the minute field.

Returns:
Value of the minute field.

hourField

public long hourField()
Accessor for the hour field.

Returns:
Value of the hour field.

dayField

public long dayField()
Accessor for the day field.

Returns:
Value of the second field.

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object


Copyright © 2010. All Rights Reserved.