001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kfs.sys.businessobject; 017 018 /** 019 * This class is a helper class which will allows us to pass control in and out of the processGeneralLedgerPendingEntry() method by 020 * reference. This was necessary since you can't increment an Integer object without breaking reference. 021 * 022 * 023 */ 024 public class GeneralLedgerPendingEntrySequenceHelper { 025 private int sequenceCounter; 026 027 /** 028 * Constructs a GeneralLedgerPendingEntrySequenceHelper.java, initializing the counter to 1. 029 */ 030 public GeneralLedgerPendingEntrySequenceHelper() { 031 this.sequenceCounter = 1; 032 } 033 034 /** 035 * Constructs a GeneralLedgerPendingEntrySequenceHelper.java, initializing the counter to the given int. 036 */ 037 public GeneralLedgerPendingEntrySequenceHelper(int initialCount) { 038 this.sequenceCounter = initialCount; 039 } 040 041 /** 042 * This method retrieves the value of the sequenceCounter attribute. 043 * 044 * @return 045 */ 046 public int getSequenceCounter() { 047 return sequenceCounter; 048 } 049 050 /** 051 * This method increments the value of the sequenceCounter attribute. 052 */ 053 public void increment() { 054 this.sequenceCounter += 1; 055 } 056 057 /** 058 * This method decrements the value of the sequenceCounter attribute. 059 */ 060 public void decrement() { 061 this.sequenceCounter -= 1; 062 } 063 }