List of utility methods to do Iterator from
Iterable | createIntegerIterator(int start) create Integer Iterator return new Iterable<Integer>() { @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { private int counter = start; @Override public boolean hasNext() { return counter < Integer.MAX_VALUE; ... |
Iterable | createIterable(final Iterator create Iterable return new Iterable<X>() { public Iterator<X> iterator() { return src; }; |
T | get(Iterator get for (int i = 0; i < position; i++) { iterator.next(); return iterator.next(); |
void | getAll(Iterator> it) Gets all the elements from an iterator and does nothing with them. while (it.hasNext())
it.next();
|
T | getAt(Iterator get At T val = null; for (int i = 0; i <= pos; i++) val = it.next(); return val; |
String | getCommaSeparatedValue(Iterator get Comma Separated Value boolean first = true; StringBuffer result = new StringBuffer(); while (it.hasNext()) { if (first) { first = false; } else { result.append(","); result.append(it.next()); return result.toString(); |
ImageTypeSpecifier | getDestinationType(ImageReadParam param, Iterator imageTypes) Gets the destination image type. if (imageTypes == null || !imageTypes.hasNext()) { throw new IllegalArgumentException("imageTypes null or empty!"); ImageTypeSpecifier imageType = null; if (param != null) { imageType = param.getDestinationType(); if (imageType == null) { ... |
Iterator | getEmptyIterator() Returns an empty iterator return new Iterator<T>() { @Override public boolean hasNext() { return false; @Override public T next() { if (!hasNext()) ... |
int | getEnumeratedObjectCount(Iterator Gets the enumerated object count. int count = 0; while (objects != null && objects.hasNext()) { @SuppressWarnings("unused") Object obj = objects.next(); count++; return count; |
Iterator | getFirstChildrendIterator(List children) Return an iterator to the first children of a list if (children != null) return children.iterator(); return null; |