org.kuali.kfs.coa.service.impl
Class AccountingPeriodServiceImpl

java.lang.Object
  extended by org.kuali.kfs.coa.service.impl.AccountingPeriodServiceImpl
All Implemented Interfaces:
AccountingPeriodService

public class AccountingPeriodServiceImpl
extends Object
implements AccountingPeriodService

This service implementation is the default implementation of the AccountingPeriod service that is delivered with Kuali.


Field Summary
protected static Set _invalidPeriodCodes
           
 
Constructor Summary
AccountingPeriodServiceImpl()
           
 
Method Summary
 int compareAccountingPeriodsByDate(AccountingPeriod tweedleDee, AccountingPeriod tweedleDum)
          This method compares two accounting periods, hopefully by comparing their closing dates.
 Collection getAllAccountingPeriods()
          The default implementation.
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
          This method retrieves an instance of the businessObjectService.
 AccountingPeriod getByDate(Date date)
          This method is a helper method to get the current period.
 AccountingPeriod getByPeriod(String periodCode, Integer fiscalYear)
          This method is a helper method to easily grab an accounting period by looking up it's period and fiscal year
 AccountingPeriod getByStringDate(String dateString)
          This method allows for AccountingPeriod retrieval via String date.
 org.kuali.rice.kns.service.DateTimeService getDateTimeService()
          Gets the dateTimeService attribute.
 Collection getOpenAccountingPeriods()
          Implements by choosing only accounting periods that are active.
protected  boolean isInvalidPeriodCode(AccountingPeriod period)
          This checks to see if the period code is empty or invalid ("13", "AB", "BB", "CB")
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          This method sets the instance of the businessObjectService.
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_invalidPeriodCodes

protected static final Set _invalidPeriodCodes
Constructor Detail

AccountingPeriodServiceImpl

public AccountingPeriodServiceImpl()
Method Detail

getAllAccountingPeriods

public Collection getAllAccountingPeriods()
The default implementation.

Specified by:
getAllAccountingPeriods in interface AccountingPeriodService
Returns:
A list of accounting periods in Kuali.
See Also:
AccountingPeriodService.getAllAccountingPeriods()

getOpenAccountingPeriods

public Collection getOpenAccountingPeriods()
Implements by choosing only accounting periods that are active.

Specified by:
getOpenAccountingPeriods in interface AccountingPeriodService
Returns:
See Also:
AccountingPeriodService.getOpenAccountingPeriods()

getByPeriod

public AccountingPeriod getByPeriod(String periodCode,
                                    Integer fiscalYear)
This method is a helper method to easily grab an accounting period by looking up it's period and fiscal year

Specified by:
getByPeriod in interface AccountingPeriodService
Parameters:
periodCode -
fiscalYear -
Returns:
an accounting period

getByStringDate

public AccountingPeriod getByStringDate(String dateString)
This method allows for AccountingPeriod retrieval via String date.

Specified by:
getByStringDate in interface AccountingPeriodService
Parameters:
String -

getByDate

public AccountingPeriod getByDate(Date date)
This method is a helper method to get the current period.

Specified by:
getByDate in interface AccountingPeriodService
Returns:
period that matches the date
See Also:
AccountingPeriodService.getByDate(java.sql.Date)

isInvalidPeriodCode

protected boolean isInvalidPeriodCode(AccountingPeriod period)
This checks to see if the period code is empty or invalid ("13", "AB", "BB", "CB")

Parameters:
period -
Returns:

compareAccountingPeriodsByDate

public int compareAccountingPeriodsByDate(AccountingPeriod tweedleDee,
                                          AccountingPeriod tweedleDum)
Description copied from interface: AccountingPeriodService
This method compares two accounting periods, hopefully by comparing their closing dates. If a is earlier than b, it should return a negative number; if a is later, it should return a positive number; and if the closing dates are equal, it should return a 0.

Specified by:
compareAccountingPeriodsByDate in interface AccountingPeriodService
Parameters:
tweedleDee - the first accounting period to compare
tweedleDum - the second accounting period to compare
Returns:
an integer representing which is earlier or later, or if they occur simultaneously
See Also:
AccountingPeriodService.compareAccountingPeriodsByDate(org.kuali.kfs.coa.businessobject.AccountingPeriod, org.kuali.kfs.coa.businessobject.AccountingPeriod)

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
This method retrieves an instance of the businessObjectService.

Returns:

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
This method sets the instance of the businessObjectService.

Parameters:
businessObjectService -

getDateTimeService

public org.kuali.rice.kns.service.DateTimeService getDateTimeService()
Gets the dateTimeService attribute.

Returns:
Returns the dateTimeService.

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.