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:eu.project.ttc.models.VariationPath.java

public VariationPath(TermVariation tv1, TermVariation... variations) {
    super();//from   w  w w  .j  a v a2  s  . c om
    this.variations = Lists.newLinkedList();
    this.variations.add(tv1);
    for (TermVariation tv : variations)
        addTermVariation(tv);
}

From source file:fr.univnantes.lina.uima.tkregex.AutomatonBuilder.java

public AutomatonBuilder() {
    super();// w w w .  j  a v a 2  s .  com
    this.matcherList = Lists.newLinkedList();
    this.quantifierList = Lists.newLinkedList();
    this.initState = null;
    this.states = new TreeSet<State>();
    this.acceptingStates = new TreeSet<State>();
}

From source file:com.sk89q.eduardo.service.event.HierarchyCache.java

protected Set<Class<?>> build(Class<?> concreteClass) {
    List<Class<?>> parents = Lists.newLinkedList();
    Set<Class<?>> classes = Sets.newHashSet();

    parents.add(concreteClass);/*w  w w .  j a  v a  2  s . c o  m*/

    while (!parents.isEmpty()) {
        Class<?> clazz = parents.remove(0);
        classes.add(clazz);

        Class<?> parent = clazz.getSuperclass();
        if (parent != null) {
            parents.add(parent);
        }

        Collections.addAll(parents, clazz.getInterfaces());
    }

    return classes;
}

From source file:exec.validate_evaluation.microcommits.MicroCommitIo.java

public List<MicroCommit> read(String zip) {
    List<MicroCommit> commits = Lists.newLinkedList();
    Directory dir = new Directory(this.root);

    try (IReadingArchive ra = dir.getReadingArchive(zip)) {
        while (ra.hasNext()) {
            commits.add(ra.getNext(MicroCommit.class));
        }//  www  .j a  v a2s  .c o  m
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    return commits;
}

From source file:exec.validate_evaluation.microcommits.MicroCommitGenerationRunner.java

public void run() {
    log.init(MAX_HISTORY_LENGTH);/*from   w w w. j  a  v a  2s.co m*/
    Set<String> zips = qhIo.findQueryHistoryZips();
    log.foundZips(zips);
    for (String zip : zips) {
        log.processingZip(zip);
        List<MicroCommit> mcForUser = Lists.newLinkedList();

        Collection<List<Usage>> histories = qhIo.readQueryHistories(zip);
        log.foundHistories(histories.size());

        for (List<Usage> qh : histories) {
            List<MicroCommit> mcs = createCommits(qh);
            log.convertedToCommits(qh.size(), mcs.size());
            mcForUser.addAll(mcs);
        }
        mcIo.store(mcForUser, zip);
    }

    log.done();
}

From source file:com.facebook.buck.slb.ServerHealthState.java

public ServerHealthState(URI server, int maxSamplesStored) {
    Preconditions.checkArgument(maxSamplesStored > 0,
            "The maximum number of samples stored must be positive instead of [%s].", maxSamplesStored);
    this.maxSamplesStored = maxSamplesStored;
    this.server = server;
    this.pingLatencies = Lists.newLinkedList();
    this.requests = Lists.newLinkedList();
}

From source file:org.summer.dsl.builder.resourceloader.SerialResourceLoader.java

public LoadOperation create(final ResourceSet parent, IProject project) {
    final Queue<URI> queue = Lists.newLinkedList();
    return new CheckedLoadOperation(new LoadOperation() {

        public LoadResult next() {
            URI uri = queue.poll();
            try {
                Resource resource = parent.getResource(uri, true);
                return new LoadResult(resource, uri);
            } catch (WrappedException e) {
                throw new LoadOperationException(uri, (Exception) e.getCause());
            }//from  w  ww .j  a v a2s  . c om
        }

        public boolean hasNext() {
            return !queue.isEmpty();
        }

        public Collection<URI> cancel() {
            return queue;
        }

        public void load(Collection<URI> uris) {
            queue.addAll(getSorter().sort(uris));
        }
    });
}

From source file:org.des.tao.ide.builder.ModelBuilder.java

private void generateCode(Writer modelCodeWriter) throws IOException, TemplateException {
    Map<String, Object> modelProperties = Maps.newHashMap();
    List<Map<String, Object>> eventList = Lists.newLinkedList();
    modelProperties.put("modelName", modelName);
    modelProperties.put("events", eventList);
    modelProperties.put("variables", variableList);

    for (Event event : events) {
        EventBuilder eventBuilder = new EventBuilder();
        Event.EventState eventState = event.getEventState();
        Event.Function eventFunctionMatcher = new Event.Function(eventState.getFunctionBody());
        eventFunctionMatcher.process();//from  w w  w  . j  a  v  a2s .  co m

        eventBuilder.setName(eventState.getName());
        eventBuilder.setParameters(eventFunctionMatcher.getParameters());
        eventBuilder.setBody(eventFunctionMatcher.getBody());

        for (Map.Entry<Event, List<Edge>> targetEntry : adjacencyList.row(event).entrySet()) {
            List<Edge> edges = targetEntry.getValue();

            for (Edge edge : edges) {
                eventBuilder.addEdge(edge);
            }
        }

        eventList.add(eventBuilder.asMap());
    }

    Templates templatesInstance = Templates.getTemplatesInstance();
    Configuration templateConfiguration = templatesInstance.getConfiguration();
    Template modelTemplate = templateConfiguration.getTemplate("Simulation.java.ftl");

    modelTemplate.process(modelProperties, modelCodeWriter);
}

From source file:org.polarsys.reqcycle.utils.iterators.collectors.ArcHarvester.java

public ArcHarvester(IHarvester basicHarvester, Iterable<IPicker> basicPickers) {
    this.basicHarvester = basicHarvester;
    this.pickers = basicPickers;

    // Transforming the original pickers into arc pickers.
    List<IPicker> arcPickers = Lists.newLinkedList();
    for (IPicker basicPicker : basicPickers) {
        ArcPicker arcPicker = new ArcPicker(basicPicker);
        arcPickers.add(arcPicker);/* www  . j  a  v a 2  s  .  c  o  m*/
    }
    this.basicHarvester.setPickers(arcPickers);
}

From source file:com.netflix.aegisthus.io.commitlog.CommitLogScanner.java

@SuppressWarnings("rawtypes")
public CommitLogScanner(DataInput di, Map<String, AbstractType> convertors, Descriptor.Version version) {
    super(di, convertors, -1, version);
    cache = Lists.newLinkedList();
}