Example usage for java.util ListIterator hasPrevious

List of usage examples for java.util ListIterator hasPrevious

Introduction

In this page you can find the example usage for java.util ListIterator hasPrevious.

Prototype

boolean hasPrevious();

Source Link

Document

Returns true if this list iterator has more elements when traversing the list in the reverse direction.

Usage

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;
}