Example usage for com.google.common.collect Iterators unmodifiableIterator

List of usage examples for com.google.common.collect Iterators unmodifiableIterator

Introduction

In this page you can find the example usage for com.google.common.collect Iterators unmodifiableIterator.

Prototype

@Deprecated
public static <T> UnmodifiableIterator<T> unmodifiableIterator(UnmodifiableIterator<T> iterator) 

Source Link

Document

Simply returns its argument.

Usage

From source file:es.upm.dit.xsdinferencer.datastructures.Automaton.java

/**
 * @return an iterator over the nodes.// w w w.  j av a  2  s  .c  o  m
 */
@Override
public Iterator<E> iterator() {
    List<E> nodesList = new LinkedList<E>(nodes);
    Collections.sort(nodesList);
    return Iterators.unmodifiableIterator(nodesList.iterator());
}

From source file:com.b2international.snowowl.datastore.cdo.CDOUtils.java

private static Iterator<CDOBranch> bottomToTopIterator0(final CDOBranch branch) {
    Preconditions.checkNotNull(branch, "CDO branch argument cannot be null.");
    if (branch.isMainBranch()) {
        return Collections.singleton(branch).iterator();
    }/*  w ww.ja va  2  s . com*/

    final List<CDOBranch> $ = Lists.newArrayList();
    $.add(branch);
    CDOBranch ancestor = branch.getBase().getBranch();

    for (;;) {

        if (null == ancestor) {

            //reached repository creation time
            break;

        }

        $.add(ancestor);
        final CDOBranchPoint base = ancestor.getBase();
        ancestor = base.getBranch();

    }

    return Iterators.unmodifiableIterator($.iterator());

}