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

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

Introduction

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

Prototype

public static <T> UnmodifiableIterator<T> singletonIterator(@Nullable final T value) 

Source Link

Document

Returns an iterator containing only value .

Usage

From source file:org.apache.drill.exec.store.sys.ProfileInfoIterator.java

private Iterator<ProfileInfo> iterateProfileInfo() {
    try {/*from w ww  .  j ava2  s .c o m*/
        //Transform authorized profiles to iterator for ProfileInfo
        return transform(getAuthorizedProfiles(queryingUsername, isAdmin));
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
        return Iterators.singletonIterator(ProfileInfo.getDefault());
    }
}

From source file:org.sonar.css.tree.impl.AtRuleTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    if (preludes != null) {
        return Iterators.concat(Iterators.singletonIterator(atKeyword), preludes.iterator(),
                Iterators.forArray(block, semicolon));
    } else {/*from   w w w .j  a va2  s  . c  om*/
        return Iterators.forArray(atKeyword, block);
    }
}

From source file:org.opendaylight.yangtools.util.SingletonSet.java

@Override
public final Iterator<E> iterator() {
    return Iterators.singletonIterator(getElement());
}

From source file:org.sonar.css.tree.impl.scss.ScssAtRootParametersTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.forArray(openParenthesis, parameter, colon), values.iterator(),
            Iterators.singletonIterator(closeParenthesis));
}

From source file:org.sonar.javascript.tree.impl.expression.jsx.JsxOpeningElementTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.forArray(ltToken, elementName), attributes.iterator(),
            Iterators.singletonIterator(gtToken));
}

From source file:org.sonar.css.tree.impl.AtRuleBlockTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    if (content != null) {
        return Iterators.concat(Iterators.singletonIterator(openCurlyBrace), content.iterator(),
                Iterators.singletonIterator(closeCurlyBrace));
    } else {//w w  w  . j  ava  2  s.  c  o  m
        return Iterators.forArray(openCurlyBrace, closeCurlyBrace);
    }
}

From source file:org.sonar.php.tree.impl.statement.BlockTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.singletonIterator(openCurlyBraceToken), statements.iterator(),
            Iterators.singletonIterator(closeCurlyBraceToken));
}

From source file:de.monticore.utils.NodeWithParent.java

@Override
public Iterator<NodeWithParent<?>> iterator() {
    Iterator<NodeWithParent<?>> childIterator = Iterables.concat(children).iterator();
    return Iterators.concat(Iterators.singletonIterator(this), childIterator);
}

From source file:ch.ethz.inf.vs.hypermedia.corehal.block.LocationCrawler.java

public LocationCrawler(LocationDescriptionFuture startLocation) {
    super(() -> Iterators.singletonIterator(startLocation));
    this.startLocation = startLocation;
}

From source file:org.sonar.php.tree.impl.statement.GlobalStatementTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.singletonIterator(globalToken), variables.elementsAndSeparators(),
            Iterators.singletonIterator(eosToken));
}