All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bixuebihui.jdbc.ParamsIterator Maven / Gradle / Ivy

Go to download

a fast small database connection pool and a active record flavor mini framework

There is a newer version: 1.15.3.3
Show newest version
package com.bixuebihui.jdbc;

import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * 

ParamsIterator class.

* * @author xingwx * @version $Id: $Id */ public class ParamsIterator implements Iterable { public interface CurrentParameters { Object[] getCurrent(int index); } int total = 0; int index = 0; CurrentParameters cur; /** * {@inheritDoc} */ @Override public Iterator iterator() { return new Iterator() { @Override public boolean hasNext() { return index < total; } @Override public Object[] next() { if (!hasNext()) { throw new NoSuchElementException(); } return cur.getCurrent(index++); } }; } /** *

Constructor for ParamsIterator.

* * @param total a int. * @param cur a {@link ParamsIterator.CurrentParameters} object. */ public ParamsIterator(int total, CurrentParameters cur) { this.total = total; this.cur = cur; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy