Package org.apache.commons.collections.iterators

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


     * returns an iterator on all the enumerated instaces.
     * @return iterator
     */
    public static Iterator<SortOrderEnum> iterator()
    {
        return new ArrayIterator(ALL);
    }
View Full Code Here


     * @return
     */
    @SuppressWarnings("unchecked")
    @Nonnull
    public static <T> Iterator<T> arrayIterator(T[] values, int from, int to) {
        return new ArrayIterator(values, from, to);
    }
View Full Code Here

                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

     * @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

    /**
     *
     * @see org.acegisecurity.afterinvocation.Filterer#iterator()
     */
    public Iterator iterator() {
        return new ArrayIterator(list);
    }
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

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.