Package org.apache.commons.collections.iterators

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


    return result;
  }

  public Iterator<String> iterator() {
    if (value != null) {
      return new SingletonIterator(value);
    }
    if (values != null) {
      return new ObjectArrayIterator(values);
    }
    return EmptyIterator.INSTANCE;
View Full Code Here


        return new IteratorChain(first, second);
    }

    @SuppressWarnings("unchecked")
    private static <T> Iterator<T> singleton(T value) {
        return new SingletonIterator(value);
    }
View Full Code Here

        return new IteratorChain(first, second);
    }

    @SuppressWarnings("unchecked")
    private static <T> Iterator<T> singleton(T value) {
        return new SingletonIterator(value);
    }
View Full Code Here

        {
            itValues = PropertyConverter.toIterator(value, getListDelimiter());
        }
        else
        {
            itValues = new SingletonIterator(value);
        }

        while (itNodes.hasNext() && itValues.hasNext())
        {
            ((ConfigurationNode) itNodes.next()).setValue(itValues.next());
View Full Code Here

            {
                return split((String) value, delimiter).iterator();
            }
            else
            {
                return new SingletonIterator(value);
            }
        }
        else if (value instanceof Collection)
        {
            return toIterator(((Collection) value).iterator(), delimiter);
        }
        else if (value.getClass().isArray())
        {
            return toIterator(IteratorUtils.arrayIterator(value), delimiter);
        }
        else if (value instanceof Iterator)
        {
            Iterator iterator = (Iterator) value;
            IteratorChain chain = new IteratorChain();
            while (iterator.hasNext())
            {
                chain.addIterator(toIterator(iterator.next(), delimiter));
            }
            return chain;
        }
        else
        {
            return new SingletonIterator(value);
        }
    }
View Full Code Here

    return result;
  }

  public Iterator<String> iterator() {
    if (value != null) {
      return new SingletonIterator(value);
    }
    if (values != null) {
      return new ObjectArrayIterator(values);
    }
    return EmptyIterator.INSTANCE;
View Full Code Here

  public List<Item> createMessageList(FacesContext facesContext) {

    Iterator clientIds;
    if (isGlobalOnly()) {
      clientIds = new SingletonIterator(null);
    } else if (getFor() != null) {
      clientIds = new SingletonIterator(getFor());
    } else {
      clientIds = facesContext.getClientIdsWithMessages();
    }

    List<Item> messages = collectMessageList(facesContext, clientIds);
View Full Code Here

        {
            itValues = PropertyConverter.toIterator(value, getListDelimiter());
        }
        else
        {
            itValues = new SingletonIterator(value);
        }
        while (itNodes.hasNext() && itValues.hasNext())
        {
            ((ConfigurationNode) itNodes.next()).setValue(itValues.next());
        }
View Full Code Here

            {
                return split((String) value, delimiter).iterator();
            }
            else
            {
                return new SingletonIterator(value);
            }
        }
        else if (value instanceof Collection)
        {
            return toIterator(((Collection) value).iterator(), delimiter);
        }
        else if (value.getClass().isArray())
        {
            return toIterator(IteratorUtils.arrayIterator(value), delimiter);
        }
        else if (value instanceof Iterator)
        {
            Iterator iterator = (Iterator) value;
            IteratorChain chain = new IteratorChain();
            while (iterator.hasNext())
            {
                chain.addIterator(toIterator(iterator.next(), delimiter));
            }
            return chain;
        }
        else
        {
            return new SingletonIterator(value);
        }
    }
View Full Code Here

            {
                Attr attr = (Attr) w3cNode;
                Iterator it;
                if (isDelimiterParsingDisabled())
                {
                    it = new SingletonIterator(attr.getValue());
                }
                else
                {
                    it = PropertyConverter.split(attr.getValue(), getListDelimiter()).iterator();
                }
View Full Code Here

TOP

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

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.