Back to project page DKO.
The source code is released under:
GNU Lesser General Public License
If you think the Android project DKO listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.kered.dko; /*w ww . j ava 2 s. co m*/ import java.util.Iterator; class SelectSingleColumn<S> implements Iterable<S> { private final Field<S> field; private final Query<? extends Table> q; SelectSingleColumn(final Query<? extends Table> q, final Field<S> field) { this.q = q; this.field = field; } @Override public Iterator<S> iterator() { return new Iterator<S>() { private S next = null; private final Iterable<? extends Table> it1 = q.onlyFields(field); private final Iterator<? extends Table> it = it1.iterator(); @Override public boolean hasNext() { if (next != null) return true; if (it.hasNext()) { next = it.next().get(field); return true; } return false; } @Override public S next() { if (hasNext()) { final S tmp = next; next = null; return tmp; } throw new RuntimeException("no more available"); } @Override public void remove() { throw new RuntimeException("remove not implemented"); } }; } }