org.kuali.kfs.module.ec.util
Enum AccountingPeriodMonth

java.lang.Object
  extended by java.lang.Enum<AccountingPeriodMonth>
      extended by org.kuali.kfs.module.ec.util.AccountingPeriodMonth
All Implemented Interfaces:
Serializable, Comparable<AccountingPeriodMonth>

public enum AccountingPeriodMonth
extends Enum<AccountingPeriodMonth>

To enumerate the accounting periods as months and provides a set of utilities to manage the period code.


Enum Constant Summary
MONTH1
           
MONTH10
           
MONTH11
           
MONTH12
           
MONTH2
           
MONTH3
           
MONTH4
           
MONTH5
           
MONTH6
           
MONTH7
           
MONTH8
           
MONTH9
           
 
Field Summary
 String periodCode
           
 
Method Summary
static Set<String> buildPeriodCodeSetWithinRange(AccountingPeriodMonth beginPeriod, AccountingPeriodMonth endPeriod)
          get the period codes between the begin period and the end period.
static AccountingPeriodMonth findAccountingPeriod(String periodCode)
          find an accounting period with the given period code
static Map<Integer,Set<String>> findAccountingPeriodsBetween(Integer beginYear, String beginPeriodCode, Integer endYear, String endPeriodCode)
          find all accounting periods between the given begin period and end period.
static AccountingPeriodMonth valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AccountingPeriodMonth[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MONTH1

public static final AccountingPeriodMonth MONTH1

MONTH2

public static final AccountingPeriodMonth MONTH2

MONTH3

public static final AccountingPeriodMonth MONTH3

MONTH4

public static final AccountingPeriodMonth MONTH4

MONTH5

public static final AccountingPeriodMonth MONTH5

MONTH6

public static final AccountingPeriodMonth MONTH6

MONTH7

public static final AccountingPeriodMonth MONTH7

MONTH8

public static final AccountingPeriodMonth MONTH8

MONTH9

public static final AccountingPeriodMonth MONTH9

MONTH10

public static final AccountingPeriodMonth MONTH10

MONTH11

public static final AccountingPeriodMonth MONTH11

MONTH12

public static final AccountingPeriodMonth MONTH12
Field Detail

periodCode

public final String periodCode
Method Detail

values

public static AccountingPeriodMonth[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AccountingPeriodMonth c : AccountingPeriodMonth.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static AccountingPeriodMonth valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

findAccountingPeriod

public static AccountingPeriodMonth findAccountingPeriod(String periodCode)
find an accounting period with the given period code

Parameters:
periodCode - the given period code
Returns:
an accounting period with the given period code

findAccountingPeriodsBetween

public static Map<Integer,Set<String>> findAccountingPeriodsBetween(Integer beginYear,
                                                                    String beginPeriodCode,
                                                                    Integer endYear,
                                                                    String endPeriodCode)
find all accounting periods between the given begin period and end period. Here, a period can be represented by the combination of year and period code. The begin perid should be no later than the end period.

Parameters:
beginYear - the begin year
beginPeriodCode - the begin period code
endYear - the end year
endPeriodCode - the end period code
Returns:
all accounting periods between the given begin period and end period. The returning results are stored in a map, whose keys is year and whose values are period code set.

buildPeriodCodeSetWithinRange

public static Set<String> buildPeriodCodeSetWithinRange(AccountingPeriodMonth beginPeriod,
                                                        AccountingPeriodMonth endPeriod)
get the period codes between the begin period and the end period. The begin period should not later than the end period; otherwise, IllegalArgumentException occurs.

Parameters:
beginPeriod - the begin period
endPeriod - the end period
Returns:
the period codes between the begin period and the end period. The returning codes include The codes of begin and end periods.


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