Package org.apache.commons.collections.iterators

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


        } catch (RepositoryException re) {
            log.warn("inconsistent hierarchy state", re);
        }
        // create an iterator over the collected descendants
        // in decreasing depth order
        IteratorChain resultIter = new IteratorChain();
        for (int i = la.length - 1; i >= 0; i--) {
            List list = la[i];
            if (list != null) {
                resultIter.addIterator(list.iterator());
            }
        }
        /**
         * if the resulting iterator chain is empty return
         * EMPTY_LIST.iterator() instead because older versions
         * of IteratorChain (pre Commons Collections 3.1)
         * would throw UnsupportedOperationException in this
         * situation
         */
        if (resultIter.getIterators().isEmpty()) {
            List<ItemState> empty = Collections.emptyList();
            return empty.iterator();
        }
        return resultIter;
    }
View Full Code Here


        } catch (RepositoryException re) {
            log.warn("inconsistent hierarchy state", re);
        }
        // create an iterator over the collected descendants
        // in decreasing depth order
        IteratorChain resultIter = new IteratorChain();
        for (int i = la.length - 1; i >= 0; i--) {
            List list = la[i];
            if (list != null) {
                resultIter.addIterator(list.iterator());
            }
        }
        /**
         * if the resulting iterator chain is empty return
         * EMPTY_LIST.iterator() instead because older versions
         * of IteratorChain (pre Commons Collections 3.1)
         * would throw UnsupportedOperationException in this
         * situation
         */
        if (resultIter.getIterators().isEmpty()) {
            List<ItemState> empty = Collections.emptyList();
            return empty.iterator();
        }
        return resultIter;
    }
View Full Code Here

     * @param includeAttic
     * @return iterator over all children entries, that currently are loaded
     * with this NodeEntry
     */
    private Iterator getAllChildEntries(boolean includeAttic) {
        IteratorChain chain = new IteratorChain();
        // attic
        if (includeAttic) {
            Collection attic = propertiesInAttic.values();
            chain.addIterator(new ArrayList(attic).iterator());
        }
        // add props
        synchronized (properties) {
            Collection props = properties.getPropertyEntries();
            chain.addIterator(props.iterator());
        }
        // add childNodeEntries
        synchronized (childNodeEntries) {
            chain.addIterator(childNodeEntries.iterator());
        }
        return chain;
    }
View Full Code Here

                        }
                    } catch (RepositoryException e) {
                        // currentNode is probably stale
                    }
                }
                selfAndChildren = new IteratorChain(allIterators);
            }
        }
View Full Code Here

                userAces.addAll(uaces);
            }
        }

        private Iterator<AccessControlEntry> iterator() {
            return new IteratorChain(userAces.iterator(), groupAces.iterator());
        }
View Full Code Here

            case PrincipalManager.SEARCH_TYPE_ALL:
                PrincipalIterator[] its = new PrincipalIterator[] {
                        findUserPrincipals(simpleFilter),
                        findGroupPrincipals(simpleFilter)
                };
                return new PrincipalIteratorAdapter(new IteratorChain(its));
            default:
                throw new IllegalArgumentException("Invalid searchType");
        }
    }
View Full Code Here

        } catch (RepositoryException re) {
            log.warn("inconsistent hierarchy state", re);
        }
        // create an iterator over the collected descendants
        // in decreasing depth order
        IteratorChain resultIter = new IteratorChain();
        for (int i = la.length - 1; i >= 0; i--) {
            List list = la[i];
            if (list != null) {
                resultIter.addIterator(list.iterator());
            }
        }
        /**
         * if the resulting iterator chain is empty return
         * EMPTY_LIST.iterator() instead because older versions
         * of IteratorChain (pre Commons Collections 3.1)
         * would throw UnsupportedOperationException in this
         * situation
         */
        if (resultIter.getIterators().isEmpty()) {
            List<ItemState> empty = Collections.emptyList();
            return empty.iterator();
        }
        return resultIter;
    }
View Full Code Here

        } catch (RepositoryException re) {
            log.warn("inconsistent hierarchy state", re);
        }
        // create an iterator over the collected descendants
        // in decreasing depth order
        IteratorChain resultIter = new IteratorChain();
        for (int i = la.length - 1; i >= 0; i--) {
            List list = la[i];
            if (list != null) {
                resultIter.addIterator(list.iterator());
            }
        }
        /**
         * if the resulting iterator chain is empty return
         * EMPTY_LIST.iterator() instead because older versions
         * of IteratorChain (pre Commons Collections 3.1)
         * would throw UnsupportedOperationException in this
         * situation
         */
        if (resultIter.getIterators().isEmpty()) {
            List<ItemState> empty = Collections.emptyList();
            return empty.iterator();
        }
        return resultIter;
    }
View Full Code Here

            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
        {
View Full Code Here

        private boolean removeCleanInternal(StateManagerImpl sm) {
            return _clean != null && _clean.remove(sm);
        }

        public Iterator iterator() {
            IteratorChain chain = new IteratorChain();
            if (_dirty != null && !_dirty.isEmpty())
                chain.addIterator(_dirty.iterator());
            if (_clean != null && !_clean.isEmpty())
                chain.addIterator(_clean.iterator());
            return chain;
        }
View Full Code Here

TOP

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

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.