Package org.apache.commons.collections.iterators

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


        {
            colIterator = ((Collection) collectionOrArray).iterator();
        }
        else if (collectionOrArray.getClass().isArray())
        {
            colIterator = new ArrayIterator(collectionOrArray);
        }
        else
        {
            throw new OJBRuntimeException( "Given object collection of type '"
                    + (collectionOrArray != null ? collectionOrArray.getClass().toString() : "null")
View Full Code Here


    // Foreign Key fields retrieved here map to FieldDescriptors of the table in the collection
    System.err.println(toString());
      java.util.Iterator it;
      try
      {
        it = new ArrayIterator(collectionDescriptor.getFksToThisClass());
        while (it.hasNext())
          newChildren.add(new javax.swing.tree.DefaultMutableTreeNode("FksToThisClass: " + it.next().toString()));
        it = new ArrayIterator(collectionDescriptor.getFksToItemClass());
        while (it.hasNext())
          newChildren.add(new javax.swing.tree.DefaultMutableTreeNode("FksToItemClass: " + it.next().toString()));
       
      }
      catch (NullPointerException npe)
View Full Code Here

        if (o instanceof Iterable)
            itty = ((Iterable) o).iterator();
        else if (o instanceof Iterator)
            itty = (Iterator) o;
        else if (o instanceof Object[])
            itty = new ArrayIterator(o);
        else if (o instanceof Stream)
            itty = ((Stream) o).iterator();
        else if (o instanceof Map)
            itty = ((Map) o).entrySet().iterator();
        else if (o instanceof Throwable)
View Full Code Here

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

            return list.iterator();
        } else if ( value instanceof Map ) {
            Map map = (Map) value;
            return map.entrySet().iterator();
        } else if ( value.getClass().isArray() ) {
            return new ArrayIterator( value );
        } else if ( value instanceof Enumeration ) {
            return new EnumerationIterator((Enumeration ) value);
        } else if ( value instanceof Collection ) {
          Collection collection = (Collection) value;
          return collection.iterator();
        } else if ( value instanceof String ) {
           String[] array = StringUtils.split((String) value, "," );
           array = StringUtils.stripAll( array );
           return new ArrayIterator( array );
        } else {
            // XXX: should we return single iterator?
            return new SingletonIterator( value );
        }
    }
View Full Code Here

      public Iterator<Object> getSubPathIterator(int fromIndex) {
        throw new UnsupportedOperationException();
      }

      public Iterator<Object> iterator() {
        return new ArrayIterator(data);
      }

      @Override
      public TreeRowKey<Object> getParentKey() {
        throw new UnsupportedOperationException();
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 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

                {
                    userColIterator = ((Collection) userCol).iterator();
                }
                else if (type.isArray())
                {
                    userColIterator = new ArrayIterator(userCol);
                }
                else
                {
                    throw new OJBRuntimeException(
                        userCol.getClass()
View Full Code Here

                {
                    colIterator = ((Collection) col).iterator();
                }
                else if (type.isArray())
                {
                    colIterator = new ArrayIterator(col);
                }
                else
                {
                    continue;
                }
View Full Code Here

                    {
                        colIterator = ((Collection) col).iterator();
                    }
                    else if (type.isArray())
                    {
                        colIterator = new ArrayIterator(col);
                    }
                    else
                    {
                        continue;
                    }
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.