Java Code Examples for com.google.common.collect.Iterators#forArray()

The following examples show how to use com.google.common.collect.Iterators#forArray() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicPath.java    From monsoon with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public int compareTo(Self o) {
    if (o == null) return 1;
    int cmp = 0;

    final Iterator<String> self_iter = Iterators.forArray(path);
    final Iterator<String> othr_iter = Iterators.forArray(((BasicPath)o).path);
    while (cmp == 0 && self_iter.hasNext() && othr_iter.hasNext())
        cmp = self_iter.next().compareTo(othr_iter.next());
    if (cmp == 0)
        cmp = (self_iter.hasNext() ? 1 : othr_iter.hasNext() ? -1 : 0);

    return cmp;
}
 
Example 2
Source File: GarbageCollectors.java    From elasticsearch-helper with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<GarbageCollector> iterator() {
    return Iterators.forArray(collectors);
}
 
Example 3
Source File: ScssFunctionTreeImpl.java    From sonar-css-plugin with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.forArray(directive(), name(), parameters(), block);
}
 
Example 4
Source File: MessageSourceTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(environmentKeyword, environment, messageKeyword, message, exceptionKeyword,
			exception);
}
 
Example 5
Source File: ScssDirectiveValueTreeImpl.java    From sonar-css-plugin with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.forArray(directive, value, semicolon);
}
 
Example 6
Source File: ReturnTypeTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(returnsKeyword, dataType, notKeyword, nullKeyword, nullableKeyword);
}
 
Example 7
Source File: LanguageTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(languageKeyword, languageName);
}
 
Example 8
Source File: PropertyDeclarationTreeImpl.java    From sonar-css-plugin with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.forArray(property, colon, value, semicolon);
}
 
Example 9
Source File: CompoundTerm.java    From opennars with MIT License 4 votes vote down vote up
@Override
public Iterator<Term> iterator() {
    return Iterators.forArray(term);
}
 
Example 10
Source File: SqlStateTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(sqlstateKeyword, likeKeyword, likeText, escapeKeyword, escapeText, valueKeyword,
			valueText);
}
 
Example 11
Source File: StatementsTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(statements.toArray(new Tree[statements.size()]));
}
 
Example 12
Source File: ControlsTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(finalizeKeyword, finalizeType, deleteKeyword, deleteType);
}
 
Example 13
Source File: GameMessageRepository.java    From luna with MIT License 4 votes vote down vote up
@Override
public UnmodifiableIterator<GameMessageReader> iterator() {
    return Iterators.forArray(readers);
}
 
Example 14
Source File: ResignalStatementTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(resignalKeyword, semi);
}
 
Example 15
Source File: FsInfo.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Path> iterator() {
    return Iterators.forArray(paths);
}
 
Example 16
Source File: ElseClauseTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.<Tree>forArray(elseKeyword, statements);
}
 
Example 17
Source File: IterateStatementTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(iterateKeyword, label, semi);
}
 
Example 18
Source File: ScssPlaceholderSelectorTreeImpl.java    From sonar-css-plugin with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.forArray(prefix, name);
}
 
Example 19
Source File: WhereClauseTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {
	return Iterators.forArray(whereKeyword, expression);
}
 
Example 20
Source File: TheFunctionTreeImpl.java    From sonar-esql-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Tree> childrenIterator() {

	return Iterators.<Tree> forArray(theKeyword, openingParenthesis, expression, closingParenthesis);
}