com.atlassian.greenhopper.model.team
Class DefaultTimeAllocation

java.lang.Object
  extended by com.atlassian.greenhopper.model.team.DefaultTimeAllocation
All Implemented Interfaces:
DaysAllocation, TimeAllocation

public class DefaultTimeAllocation
extends java.lang.Object
implements TimeAllocation

Default implementation of TimeAllocation Note: this object is incomplete and won't properly return data for a given user


Constructor Summary
DefaultTimeAllocation(org.joda.time.DateMidnight startDay, org.joda.time.DateMidnight endDay, java.util.List<org.joda.time.DateMidnight> workingDays, long secondsPerDay)
           
 
Method Summary
 org.joda.time.DateMidnight getEndDate()
          Contains the end day of the date range provide by this team allocation object
 org.joda.time.DateMidnight getStartDate()
          Contains the start date of the date range provided by this team allocation object
 long getTime(org.joda.time.DateMidnight day)
          Get the total time for a single day.
 java.util.Map<org.joda.time.DateMidnight,java.lang.Long> getTimePerDay()
          Get the time on a per-day basis.
 long getTotalTime()
          Get the total time for the whole allocation period.
 java.util.List<org.joda.time.DateMidnight> getWorkingDays()
          Get all days where at least one team member is working
 int getWorkingDaysCount()
          Get the number of working days
 boolean hasWorkingDays()
          Returns whether this allocation object contains any working days
 boolean isWorkingDay(org.joda.time.DateMidnight day)
          Does the provided DateMidnight object represent a working day?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTimeAllocation

public DefaultTimeAllocation(org.joda.time.DateMidnight startDay,
                             org.joda.time.DateMidnight endDay,
                             java.util.List<org.joda.time.DateMidnight> workingDays,
                             long secondsPerDay)
Method Detail

getStartDate

public org.joda.time.DateMidnight getStartDate()
Description copied from interface: DaysAllocation
Contains the start date of the date range provided by this team allocation object

Specified by:
getStartDate in interface DaysAllocation
Returns:
the start date. This is the same value as initially passed into the service to fetch the team allocation object

getEndDate

public org.joda.time.DateMidnight getEndDate()
Description copied from interface: DaysAllocation
Contains the end day of the date range provide by this team allocation object

Specified by:
getEndDate in interface DaysAllocation
Returns:
the end date. This is the same value as initially passed into the service to fetch the team allocation object

hasWorkingDays

public boolean hasWorkingDays()
Description copied from interface: DaysAllocation
Returns whether this allocation object contains any working days

Specified by:
hasWorkingDays in interface DaysAllocation
Returns:
true if at least one working day is contained, false otherwise

getWorkingDaysCount

public int getWorkingDaysCount()
Description copied from interface: DaysAllocation
Get the number of working days

Specified by:
getWorkingDaysCount in interface DaysAllocation
Returns:
the number of working days

isWorkingDay

public boolean isWorkingDay(org.joda.time.DateMidnight day)
Description copied from interface: DaysAllocation
Does the provided DateMidnight object represent a working day?

Specified by:
isWorkingDay in interface DaysAllocation

getWorkingDays

public java.util.List<org.joda.time.DateMidnight> getWorkingDays()
Description copied from interface: DaysAllocation
Get all days where at least one team member is working

Specified by:
getWorkingDays in interface DaysAllocation

getTotalTime

public long getTotalTime()
Description copied from interface: TimeAllocation
Get the total time for the whole allocation period.

Specified by:
getTotalTime in interface TimeAllocation
Returns:
the total in seconds

getTimePerDay

public java.util.Map<org.joda.time.DateMidnight,java.lang.Long> getTimePerDay()
Description copied from interface: TimeAllocation
Get the time on a per-day basis.

Specified by:
getTimePerDay in interface TimeAllocation

getTime

public long getTime(org.joda.time.DateMidnight day)
Description copied from interface: TimeAllocation
Get the total time for a single day.

Specified by:
getTime in interface TimeAllocation
Parameters:
day - the day to fetch the total for
Returns:
the total in seconds


Copyright © 2007-2014 Atlassian. All Rights Reserved.