Example usage for com.google.common.collect Lists newLinkedList

List of usage examples for com.google.common.collect Lists newLinkedList

Introduction

In this page you can find the example usage for com.google.common.collect Lists newLinkedList.

Prototype

@GwtCompatible(serializable = true)
public static <E> LinkedList<E> newLinkedList() 

Source Link

Document

Creates a mutable, empty LinkedList instance (for Java 6 and earlier).

Usage

From source file:ru.frostman.web.secure.inject.SecureSupport.java

private static void buildUserServiceInjection(List<InjectionRule> injectionRules,
        UserServiceProvider provider) {/*from  w w  w .jav  a  2s  . c o  m*/
    List<String> classNames = Lists.newLinkedList();
    classNames.add(UserService.class.getName());
    classNames.add(provider.getUserServiceClass().getName());

    InjectionRule rule = new BaseInjection(Lists.<String>newLinkedList(), classNames, "",
            SECURITY_MANAGER_GET + ".getUserService()", "");

    injectionRules.add(rule);
}

From source file:com.google.jstestdriver.FailureCheckerAction.java

public RunData run(RunData runData) {
    if (accumulator.hasFailures()) {
        throw new FailureException("Tests failed. See log for details.");
    }//from  w  w w  .  ja  v a  2 s  . com
    List<String> failures = Lists.newLinkedList();
    Map<BrowserInfo, Collection<TestResult>> resultsCollections = holder.getResults().asMap();

    if (holder.getResults().isEmpty()) {
        throw new FailureException("No tests executed.");
    }
    for (Entry<BrowserInfo, Collection<TestResult>> entry : resultsCollections.entrySet()) {
        if (entry.getValue().isEmpty()) {
            failures.add(entry.getKey() + " had no tests executed.");
        }
    }
    if (!failures.isEmpty()) {
        throw new FailureException(Joiner.on("\n").join(failures));
    }
    return runData;
}

From source file:org.gradoop.io.impl.tlf.functions.VertexLabelList.java

@Override
public void flatMap(GraphTransaction<G, V, E> graphTransaction, Collector<List<String>> collector)
        throws Exception {
    List<String> list = Lists.newLinkedList();
    for (V vertex : graphTransaction.getVertices()) {
        list.add(vertex.getLabel());/*from   w  ww  . ja va  2  s. c  om*/
    }
    collector.collect(list);
}

From source file:org.locationtech.geogig.osm.internal.history.Relation.java

public Relation() {
    super();
    members = Lists.newLinkedList();
}

From source file:org.sonar.batch.issue.ignore.pattern.PatternDecoder.java

public List<IssuePattern> decode(String patternsList) {
    List<IssuePattern> patterns = Lists.newLinkedList();
    String[] patternsLines = StringUtils.split(patternsList, "\n");
    for (String patternLine : patternsLines) {
        IssuePattern pattern = decodeLine(patternLine.trim());
        if (pattern != null) {
            patterns.add(pattern);/*from ww w  .java  2s. c  o m*/
        }
    }
    return patterns;
}

From source file:org.apache.flume.client.avro.BufferedLineReader.java

@Override
public List<String> readLines(int n) throws IOException {
    List<String> out = Lists.newLinkedList();
    String line;// w w  w.j  a v  a  2s  . co  m
    while ((line = readLine()) != null && out.size() < n) {
        out.add(line);
    }
    return out;
}

From source file:org.apache.tez.history.parser.datamodel.BaseParser.java

public BaseParser() {
    vertexList = Lists.newLinkedList();
    taskList = Lists.newLinkedList();
    attemptList = Lists.newLinkedList();
}

From source file:integration.simpleusages.InSameContext.java

@Override
public List<Usage> getValidationData() {
    List<Usage> usages = Lists.newLinkedList();

    usages.add(createUsageWithB());

    return usages;
}

From source file:org.gradle.configuration.DefaultImportsReader.java

public DefaultImportsReader() {
    try {/*w w  w .  j  a  va  2s.  c  om*/
        URL url = getClass().getResource(RESOURCE);
        if (url == null) {
            throw new IllegalStateException("Could not load default imports resource: " + RESOURCE);
        }
        this.importPackages = Resources.asCharSource(url, Charsets.UTF_8)
                .readLines(new LineProcessor<String[]>() {
                    private final List<String> packages = Lists.newLinkedList();

                    @Override
                    public boolean processLine(@SuppressWarnings("NullableProblems") String line)
                            throws IOException {
                        packages.add(line.substring(7, line.length() - 2));
                        return true;
                    }

                    @Override
                    public String[] getResult() {
                        return packages.toArray(new String[packages.size()]);
                    }
                });
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}

From source file:com.google.jstestdriver.html.HtmlDocNodeFactory.java

public void create(BufferedTokenStream stream, Nodes nodes) {
    Token id = null;// w  w  w  .j av  a  2 s  .  co  m
    List<Token> html = Lists.newLinkedList();

    if (!DOC_START.equals(stream.read())) {
        stream.reset();
        return;
    }

    id = stream.read();

    if (!EQUALS.equals(stream.read())) {
        stream.reset();
        return;
    }

    while (stream.available()) {
        Token token = stream.read();
        if (END_COMMENT.equals(token)) {
            break;
        }
        html.add(token);
    }

    stream.mark();
    nodes.add(createStrategy.create(id, html));
}