List of usage examples for java.util ListIterator hasPrevious
boolean hasPrevious();
From source file:org.regenstrief.util.Util.java
/** * Resets a ListIterator/*from www . j a va2 s . c o m*/ * * @param i the ListIterator * @param <E> the element type * @return the ListIterator **/ public final static <E> ListIterator<E> reset(final ListIterator<E> i) { for (; (i != null) && i.hasPrevious(); i.previous()) { ; } return i; }
From source file:com.gst.portfolio.loanaccount.domain.Loan.java
private LocalDate determineExpectedMaturityDate() { final int numberOfInstallments = this.repaymentScheduleInstallments.size(); List<LoanRepaymentScheduleInstallment> installments = getRepaymentScheduleInstallments(); LocalDate maturityDate = installments.get(numberOfInstallments - 1).getDueDate(); ListIterator<LoanRepaymentScheduleInstallment> iterator = installments.listIterator(numberOfInstallments); while (iterator.hasPrevious()) { LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment = iterator.previous(); if (!loanRepaymentScheduleInstallment.isRecalculatedInterestComponent()) { maturityDate = loanRepaymentScheduleInstallment.getDueDate(); break; }/* www.j a v a 2 s . c o m*/ } return maturityDate; }