Package org.apache.commons.collections.iterators

Examples of org.apache.commons.collections.iterators.ArrayIterator


                sb.append("empty");
            }
            else
            {
                sb.append('[');
                for (Iterator it = new ArrayIterator(params); it.hasNext(); )
                {
                    sb.append(it.next());
                    if (it.hasNext())
                    {
                        sb.append(", ");
                    }
                }
                sb.append(']');
View Full Code Here


       
        for (int z = 0; z < sizeZ(); z++) {
          createIfNecessary(x, z);
        }
       
        columnIterators.add(new ArrayIterator(grid[x]));
       
      }
     
      return new IteratorChain(columnIterators);
     
View Full Code Here

        this(new File(dirName));
    }

    public FileIterator(File dir) {
        Assert.isTrue(dir.isDirectory(), "Given file must be a directory");
        fileIterator = new ArrayIterator(dir.listFiles());
    }
View Full Code Here

        this(new File(dirName), filter);
    }

    public FileIterator(File dir, FileFilter filter) {
        Assert.isTrue(dir.isDirectory(), "Given file must be a directory");
        fileIterator = new ArrayIterator(dir.listFiles(filter));
    }
View Full Code Here

        for (int i = 0; i < keys.length; i++)
        {
            keys[i] = paramsInfo[i][0];
        }

        return new ArrayIterator(keys);
    }
View Full Code Here

           
        } else if ( value != null ) {
            // if we have an array return an ArrayIterator
            Class type = value.getClass();
            if ( type.isArray() ) {
                return new ArrayIterator( value );
            }
        }
       
        // we've got something we can't deal with
        // so return an empty iterator
View Full Code Here

     * @return  an iterator over the array
     * @throws IllegalArgumentException if the array is not an array
     * @throws NullPointerException if array is null
     */
    public static ResettableIterator arrayIterator(Object array) {
        return new ArrayIterator(array);
    }
View Full Code Here

     * @throws IndexOutOfBoundsException if start is less than zero or greater
     *  than the length of the array
     * @throws NullPointerException if array is null
     */
    public static ResettableIterator arrayIterator(Object array, int start) {
        return new ArrayIterator(array, start);
    }
View Full Code Here

     * @throws IndexOutOfBoundsException if array bounds are invalid
     * @throws IllegalArgumentException if end is before start
     * @throws NullPointerException if array is null
     */
    public static ResettableIterator arrayIterator(Object array, int start, int end) {
        return new ArrayIterator(array, start, end);
    }
View Full Code Here

           
        } else if (obj instanceof Dictionary) {
            return new EnumerationIterator(((Dictionary) obj).elements());
           
        } else if (obj != null && obj.getClass().isArray()) {
            return new ArrayIterator(obj);
           
        } else {
            try {
                Method method = obj.getClass().getMethod("iterator", null);
                if (Iterator.class.isAssignableFrom(method.getReturnType())) {
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.iterators.ArrayIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.