Java 类org.apache.commons.collections.iterators.ArrayIterator 实例源码

项目:cagrid-core    文件:UndeployServiceHelper.java   
private boolean canRemoveJar(Jar currentJar) {
    Collection col = otherDeployedServices.values();
    boolean found = false;
    Iterator it = col.iterator();
    while (it.hasNext() && !found) {
        Deployment serviceD = (Deployment)it.next();
        if (serviceD.getJars() != null && serviceD.getJars().getJar() != null) {
            Iterator jarIt = new ArrayIterator(serviceD.getJars().getJar());
            while (jarIt.hasNext() && !found) {
                Jar thisJar = (Jar) jarIt.next();
                if (thisJar.getLocation().equals(currentJar.getLocation())
                    && thisJar.getName().equals(currentJar.getName())) {
                    found = true;
                    break;
                }
            }
        }
    }
    return !found;
}
项目:cobbzilla-utils    文件:HandlebarsUtil.java   
private static Iterator getIterator(Object thing) {
    if (thing instanceof Collection) {
        return ((Collection) thing).iterator();
    } else if (thing instanceof Map) {
        return ((Map) thing).values().iterator();
    } else if (Object[].class.isAssignableFrom(thing.getClass())) {
        return new ArrayIterator(thing);
    } else {
        return die("find: invalid argument type "+thing.getClass().getName());
    }
}
项目:displaytag    文件:SortOrderEnum.java   
/**
 * returns an iterator on all the enumerated instaces.
 * @return iterator
 */
public static Iterator<SortOrderEnum> iterator()
{
    return new ArrayIterator(ALL);
}
项目:playweb    文件:Iterators.java   
/**
 * Returns an iterator for elements of an array of <code>values</code>.
 *
 * @param <T>
 * @param values  the array to iterate over.
 * @param from  the index to start iterating at.
 * @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);
}