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:ch.ethz.inf.vs.hypermedia.corehal.block.LocationCrawler.java

public LocationCrawler(LocationDescriptionFuture startLocation, String location, int filterMode) {
    super(() -> Iterators.singletonIterator(startLocation));
    this.startLocation = startLocation;
    targetLocation = location;/* w  w  w  . j  av  a  2s.c  o  m*/
    this.filterMode = filterMode;
}

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

@Override
public Iterator<Tree> childrenIterator() {
    if (parameterElements != null) {
        return Iterators.concat(Iterators.forArray(function, openParenthesis), parameterElements.iterator(),
                Iterators.singletonIterator(closeParenthesis));
    } else {// www  . j  av  a  2s.c  o m
        return Iterators.forArray(function, openParenthesis, closeParenthesis);
    }
}

From source file:msi.gama.common.geometry.UniqueCoordinateSequence.java

@Override
public Iterator<GamaPoint> iterator() {
    return Iterators.singletonIterator(point);
}

From source file:org.sonar.javascript.tree.impl.declaration.ObjectBindingPatternTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.singletonIterator(openCurlyBrace),
            bindingElements.elementsAndSeparators(Functions.<BindingElementTree>identity()),
            Iterators.singletonIterator(closeCurlyBrace));
}

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

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.singletonIterator(openingElement), children.iterator(),
            Iterators.singletonIterator(closingElement));
}

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

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

From source file:org.sonar.php.tree.impl.expression.ListExpressionTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.concat(Iterators.singletonIterator(listToken),
            Iterators.singletonIterator(openParenthesis), elements.elementsAndSeparators(),
            Iterators.singletonIterator(closeParenthesis));
}

From source file:org.sonar.php.tree.impl.expression.LexicalVariablesTreeImpl.java

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

From source file:org.sonar.pickbasic.tree.impl.statement.ThenClauseMultiLineTreeImpl.java

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

From source file:org.sonar.javascript.model.internal.expression.ParenthesisedExpressionTreeImpl.java

@Override
public Iterator<Tree> childrenIterator() {
    return Iterators.<Tree>concat(Iterators.singletonIterator(openParenthesis),
            Iterators.singletonIterator(expression), Iterators.singletonIterator(closeParenthesis));
}