Package org.apache.commons.collections.iterators

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


    // make sure to reverse-sort it
    // so that we can delete them all
    // from the list at once without worrying
    // about adjusting each index
    List<Integer> selected=
      IteratorUtils.toList(new ArrayIterator(clientList.getSelectedIndices()));
    Collections.reverse(selected);
    Iterator<Integer> it= selected.iterator();
   
    while (it.hasNext()) {
      int idx= it.next();
View Full Code Here


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

        }
        else if(obj instanceof Collection) {
            return ((Collection)obj).iterator();
        }
        else if(obj instanceof Object[]) {
            return new ArrayIterator( obj );
        }
        else if(obj instanceof Enumeration) {
            return new EnumerationIterator( (Enumeration)obj );
        }
        else if(obj instanceof Map) {
            return ((Map)obj).values().iterator();
        }
        else if(obj != null && obj.getClass().isArray()) {
            return new ArrayIterator( obj );
        }
        else{
            return null;
        }
    }
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

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

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

     * @param array  the array over which to iterate
     * @return  an iterator over the array
     * @throws NullPointerException if array is null
     */
    public static Iterator arrayIterator(Object[] array) {
        return new ArrayIterator(array);
    }
View Full Code Here

     * @return an iterator over part of the array
     * @throws IllegalArgumentException if array bounds are invalid
     * @throws NullPointerException if array is null
     */
    public static Iterator arrayIterator(Object[] array, int start) {
        return new ArrayIterator(array, start);
    }
View Full Code Here

     * @return an iterator over part of the array
     * @throws IllegalArgumentException if array bounds are invalid
     * @throws NullPointerException if array is null
     */
    public static Iterator arrayIterator(Object[] array, int start, int end) {
        return new ArrayIterator(array, start, end);
    }
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.