Java Utililty Methods Iterator from

List of utility methods to do Iterator from

Description

The list of methods to do Iterator from are organized into topic(s).

Method

IterablecreateIntegerIterator(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;
...
IterablecreateIterable(final Iterator src)
create Iterable
return new Iterable<X>() {
    public Iterator<X> iterator() {
        return src;
};
Tget(Iterator iterator, int position)
get
for (int i = 0; i < position; i++) {
    iterator.next();
return iterator.next();
voidgetAll(Iterator it)
Gets all the elements from an iterator and does nothing with them.
while (it.hasNext())
    it.next();
TgetAt(Iterator it, int pos)
get At
T val = null;
for (int i = 0; i <= pos; i++)
    val = it.next();
return val;
StringgetCommaSeparatedValue(Iterator it)
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();
ImageTypeSpecifiergetDestinationType(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) {
...
IteratorgetEmptyIterator()
Returns an empty iterator
return new Iterator<T>() {
    @Override
    public boolean hasNext() {
        return false;
    @Override
    public T next() {
        if (!hasNext())
...
intgetEnumeratedObjectCount(Iterator objects)
Gets the enumerated object count.
int count = 0;
while (objects != null && objects.hasNext()) {
    @SuppressWarnings("unused")
    Object obj = objects.next();
    count++;
return count;
IteratorgetFirstChildrendIterator(List children)
Return an iterator to the first children of a list
if (children != null)
    return children.iterator();
return null;