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.inject.InjectionSupport.java

public static void findInjectionRules(Map<String, AppClass> classes, List<InjectionRule> injectionRules) {
    for (Map.Entry<String, AppClass> entry : classes.entrySet()) {
        AppClass appClass = entry.getValue();
        try {//  w w  w  .  ja va 2s.  c o  m
            CtClass ctClass = appClass.getCtClass();
            Component componentAnn = (Component) ctClass.getAnnotation(Component.class);

            if (componentAnn == null) {
                continue;
            }

            String name = componentAnn.value();
            List<String> classNames = Lists.newLinkedList();
            classNames.add(appClass.getName());
            classNames.addAll(Arrays.asList(componentAnn.implement()));
            List<String> annotationsNames = Lists.newLinkedList(Arrays.asList(componentAnn.annotated()));

            StringBuilder body = new StringBuilder();
            StringBuilder initCode = new StringBuilder();

            CtConstructor[] constructors = ctClass.getConstructors();
            if (constructors.length != 1) {
                throw new ActionEnhancerException(
                        "Only one constructor should be in component: " + ctClass.getName());
            }

            //todo impl singleton mode
            StringBuilder parameters = InjectEnhancer.resolveParameters(constructors[0], body);
            initCode.append("new ").append(ctClass.getName()).append("(").append(parameters).append(")");

            injectionRules.add(new BaseInjection(annotationsNames, classNames, name, initCode.toString(),
                    body.toString()));
        } catch (Exception e) {
            throw new BytecodeManipulationException(
                    "Exception while searching components in class: " + appClass.getName(), e);
        }
    }
}

From source file:org.gradle.api.internal.initialization.loadercache.HashClassPathSnapshotter.java

public ClassPathSnapshot snapshot(ClassPath classPath) {
    List<String> visitedFilePaths = Lists.newLinkedList();
    Set<File> visitedDirs = Sets.newLinkedHashSet();
    List<File> cpFiles = classPath.getAsFiles();

    Adler32 checksum = new Adler32();
    hash(checksum, visitedFilePaths, visitedDirs, cpFiles.iterator());
    return new ClassPathSnapshotImpl(visitedFilePaths, checksum.getValue());
}

From source file:questionnaire.CreationHelper.java

private static List<String> mix(List<String> intro, List<String> tasks, List<String> outro) {
    List<String> res = Lists.newLinkedList();
    res.addAll(intro);//from w  w w  .j a va2s .  c  om
    res.addAll(shuffle(tasks));
    res.addAll(outro);
    return res;
}

From source file:org.richfaces.tests.metamer.ftest.extension.configurator.config.CompositeConfigImpl.java

public CompositeConfigImpl(Config config1, Config config2) {
    this.configurations = Lists.newLinkedList();
    this.configurations.add(config1.copy());
    this.configurations.add(config2.copy());
}

From source file:org.gradle.performance.fixture.CompositeDataCollector.java

@Override
public List<String> getAdditionalArgs(File workingDir) {
    List<String> additional = Lists.newLinkedList();
    for (DataCollector collector : collectors) {
        additional.addAll(collector.getAdditionalArgs(workingDir));
    }//from  ww w .  j  a v a  2  s  . co m
    return additional;
}

From source file:com.jeroensteenbeeke.andalite.core.ResultMatchers.java

public static Matcher<Result<?, ?>> hasError(@Nonnull final String message) {
    return new TypeSafeDiagnosingMatcher<Result<?, ?>>() {
        @Override//from w  w w . j a  va  2s . co  m
        public void describeTo(Description description) {
            description.appendText("is not ok, with error ").appendText(message);
        }

        @Override
        protected boolean matchesSafely(Result<?, ?> item, Description mismatchDescription) {
            boolean ok = item.isOk();
            boolean messageEqual = message.equals(item.getMessage());
            boolean matches = !ok && messageEqual;

            if (!matches) {
                List<String> messages = Lists.newLinkedList();

                if (ok) {
                    messages.add("is ok");
                }
                if (!messageEqual) {
                    if (item.getMessage() != null) {
                        messages.add(String.format("error is %s", item.getMessage()));
                    } else {
                        messages.add("no error");
                    }
                }

                mismatchDescription.appendValueList("", ", ", "", messages);
            }

            return matches;

        }
    };
}

From source file:com.facebook.buck.rules.AbstractDependencyVisitor.java

public AbstractDependencyVisitor(Collection<BuildRule> initialDeps) {
    toExplore = Lists.newLinkedList();
    toExplore.addAll(initialDeps);
    explored = Sets.newHashSet();
}

From source file:com.google.spartancoin.script.ScriptBuilder.java

public ScriptBuilder() {
    chunks = Lists.newLinkedList();
}

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

public BatchExecutor() {
    this.batch = Lists.newLinkedList();
}

From source file:eu.interedition.collatex.simple.SimplePatternTokenizer.java

@Override
public Iterable<String> apply(@Nullable String input) {
    final Matcher matcher = pattern.matcher(input);
    final List<String> tokens = Lists.newLinkedList();
    while (matcher.find()) {
        tokens.add(input.substring(matcher.start(), matcher.end()));
    }//from w w w.j  a v a  2  s . c  om
    return tokens;
}