org.sonar.api.utils.internal
Class WorkDuration

java.lang.Object
  extended by org.sonar.api.utils.internal.WorkDuration
All Implemented Interfaces:
Serializable

public class WorkDuration
extends Object
implements Serializable

Since:
4.2
See Also:
Serialized Form

Nested Class Summary
static class WorkDuration.UNIT
           
 
Method Summary
 WorkDuration add(WorkDuration with)
           
static WorkDuration create(int days, int hours, int minutes, int hoursInDay)
           
static WorkDuration createFromValueAndUnit(int value, WorkDuration.UNIT unit, int hoursInDay)
           
 int days()
           
 boolean equals(Object o)
           
 int hashCode()
           
 int hours()
           
 int minutes()
           
 WorkDuration multiply(int factor)
           
 WorkDuration subtract(WorkDuration with)
           
 long toLong()
          Return the duration using the following format DDHHMM, where DD is the number of days, HH is the number of months, and MM the number of minutes.
 long toMinutes()
           
 String toString()
           
 double toWorkingDays()
          Return the duration in number of working days.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static WorkDuration create(int days,
                                  int hours,
                                  int minutes,
                                  int hoursInDay)

createFromValueAndUnit

public static WorkDuration createFromValueAndUnit(int value,
                                                  WorkDuration.UNIT unit,
                                                  int hoursInDay)

toWorkingDays

public double toWorkingDays()
Return the duration in number of working days. For instance, 3 days and 4 hours will return 3.5 days (if hoursIndDay is 8).


toLong

public long toLong()
Return the duration using the following format DDHHMM, where DD is the number of days, HH is the number of months, and MM the number of minutes. For instance, 3 days and 4 hours will return 030400 (if hoursIndDay is 8).


toMinutes

public long toMinutes()

add

public WorkDuration add(@Nullable
                        WorkDuration with)

subtract

public WorkDuration subtract(@Nullable
                             WorkDuration with)

multiply

public WorkDuration multiply(int factor)

days

public int days()

hours

public int hours()

minutes

public int minutes()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2014 SonarSource. All Rights Reserved.