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:net.minecraftforge.gradle.util.PredefInputSupplier.java

@Override
public List<String> gatherAll(String endFilter) {
    LinkedList<String> out = Lists.newLinkedList();
    for (String s : fileMap.keySet()) {
        if (s.endsWith(endFilter)) {
            out.add(s);//from w  w  w.  j  ava  2s.  c  o  m
        }
    }

    return out;
}

From source file:com.dogecoin.dogecoinj.script.ScriptBuilder.java

/** Creates a fresh ScriptBuilder with an empty program. */
public ScriptBuilder() {
    chunks = Lists.newLinkedList();
}

From source file:cc.kave.commons.model.naming.impl.v0.NameUtils.java

public static List<IParameterName> GetParameterNamesFromSignature(String identifierWithParameters,
        int idxOpeningBrace, int idxClosingBrace) {
    // remove opening bracket
    idxOpeningBrace++;// w  w w  .  j  a v  a2 s.  c  o  m

    // strip leading whitespace
    while (identifierWithParameters.charAt(idxOpeningBrace) == ' ') {
        idxOpeningBrace++;
    }

    List<IParameterName> parameters = Lists.newLinkedList();
    boolean hasNoParams = idxOpeningBrace == idxClosingBrace;
    if (hasNoParams) {
        return parameters;
    }

    int current = idxOpeningBrace;
    while (current < idxClosingBrace) {
        int startOfParam = current;

        if (identifierWithParameters.charAt(current) != '[') {
            current = FindNext(identifierWithParameters, current, '[');
        }
        current = FindCorrespondingCloseBracket(identifierWithParameters, current);
        current = FindNext(identifierWithParameters, current, ',', ')');
        int endOfParam = current;

        String paramSubstring = identifierWithParameters.substring(startOfParam, endOfParam);
        parameters.add(new ParameterName(paramSubstring.trim()));

        // ignore comma
        current++;
    }

    return parameters;
}

From source file:com.cloudera.nav.sdk.client.writer.registry.RegistryEntryFactory.java

private Collection<T> parseMClass(Class<?> aClass) throws IntrospectionException {
    Map<Field, Method> annInfo = MClassUtil.getAnnotatedProperties(aClass, getTypeClass());
    Collection<T> properties = Lists.newLinkedList();
    for (Map.Entry<Field, Method> entry : annInfo.entrySet()) {
        properties.add(createEntry(entry.getKey(), entry.getValue()));
    }/* w w w . ja v a 2s .co m*/
    return properties;
}

From source file:com.epam.reportportal.utils.queue.FlushableQueue.java

public FlushableQueue(FlushPolicy<E> flushPolicy) {
    this.delegate = Lists.newLinkedList();
    this.flushPolicy = flushPolicy;
}

From source file:org.geogit.di.ObjectDatabasePutInterceptor.java

private Object putAllInterceptor(MethodInvocation invocation) throws Throwable {
    Object[] arguments = invocation.getArguments();

    @SuppressWarnings("unchecked")
    final Iterator<? extends RevObject> objects = (Iterator<? extends RevObject>) arguments[0];

    final Iterator<? extends RevObject> sideEffectIterator;
    final List<RevCommit> addedCommits = Lists.newLinkedList();
    sideEffectIterator = Iterators.transform(objects, new Function<RevObject, RevObject>() {

        @Override// www.  ja  v  a  2 s . com
        public RevObject apply(RevObject input) {
            if (input instanceof RevCommit) {
                addedCommits.add((RevCommit) input);
            }
            return input;
        }
    });
    arguments[0] = sideEffectIterator;

    Object result = invocation.proceed();
    if (!addedCommits.isEmpty()) {
        GraphDatabase graphDatabase = graphDb.get();
        for (RevCommit commit : addedCommits) {
            ObjectId commitId = commit.getId();
            ImmutableList<ObjectId> parentIds = commit.getParentIds();
            graphDatabase.put(commitId, parentIds);
        }
    }

    return result;
}

From source file:com.qcadoo.view.internal.components.ganttChart.GanttChartItemImpl.java

public GanttChartItemImpl(final String row, final String name, final Long entityId, final String dateFrom,
        final String dateTo, final double from, final double to) {
    this.bgStrips = Lists.newLinkedList();
    this.rowName = row;
    this.name = name;
    this.entityId = entityId;
    this.dateFrom = dateFrom;
    this.dateTo = dateTo;
    this.from = from;
    this.to = to;
}

From source file:models.feeds.FriendsNodes.java

@Override
public void getData(Map<String, String> params, Request request, Session session, User user,
        RenderArgs renderArgs) {//w w  w.ja v a  2 s. co  m
    Integer start = 0;
    Integer count = 30;
    BasicDBObject query = new BasicDBObject("uids", user.getId());
    BasicDBObject sort = dateSort;
    DBCursor iobj = Activity.dbcol.find(query).sort(sort).skip(start).limit(count);
    // TODO tuto tu Activity transformujeme uplne zbytocne, staci _id
    List<ObjectId> nodeIds = Lists.newLinkedList();
    while (iobj.hasNext())
        nodeIds.add(MongoDB.fromDBObject(Activity.class, iobj.next()).getOid());
    renderArgs.put(dataName, NodeContent.load(nodeIds, user));
}

From source file:org.apache.streams.jackson.CleanAdditionalPropertiesProcessor.java

@Override
public List<StreamsDatum> process(StreamsDatum datum) {
    List<StreamsDatum> result = Lists.newLinkedList();
    ObjectNode activity = this.mapper.convertValue(datum.getDocument(), ObjectNode.class);
    cleanAdditionalProperties(activity);
    datum.setDocument(activity);//from   w ww.ja  v a2s.  c  om
    result.add(datum);
    return result;
}

From source file:com.textocat.textokit.postagger.DefaultAnnotationAdapter.java

@Override
public void apply(JCas jcas, Annotation token, Collection<Wordform> dictWfs) {
    Word word = new Word(jcas);
    word.setBegin(token.getBegin());//from  w ww. j  a  va  2  s  .co m
    word.setEnd(token.getEnd());
    // TODO check token type
    word.setToken((Token) token);
    List<com.textocat.textokit.morph.fs.Wordform> casWfList = Lists.newLinkedList();
    for (Wordform wf : dictWfs) {
        com.textocat.textokit.morph.fs.Wordform casWf = new com.textocat.textokit.morph.fs.Wordform(jcas);

        BitSet grammems = wf.getGrammems();
        Lemma lemma = dict.getLemma(wf.getLemmaId());
        // set lemma id
        casWf.setLemmaId(lemma.getId());
        // set lemma norm
        casWf.setLemma(lemma.getString());
        // set pos
        casWf.setPos(dict.getGramModel().getPos(lemma.getGrammems()));
        // set grammems
        grammems.or(lemma.getGrammems());
        List<String> gramSet = dict.getGramModel().toGramSet(grammems);
        casWf.setGrammems(FSUtils.toStringArray(jcas, gramSet));

        // set hosting word
        casWf.setWord(word);

        casWfList.add(casWf);
    }
    // set wordforms
    word.setWordforms(FSUtils.toFSArray(jcas, casWfList));

    word.addToIndexes();
}