Example usage for com.google.common.collect Sets newLinkedHashSet

List of usage examples for com.google.common.collect Sets newLinkedHashSet

Introduction

In this page you can find the example usage for com.google.common.collect Sets newLinkedHashSet.

Prototype

public static <E> LinkedHashSet<E> newLinkedHashSet(Iterable<? extends E> elements) 

Source Link

Document

Creates a mutable LinkedHashSet instance containing the given elements in order.

Usage

From source file:com.googlecode.blaisemath.graph.NodeSetInGraph.java

public NodeSetInGraph(Set<E> nodes, @Nullable Graph<E> graph) {
    checkNotNull(nodes);/*  w  ww . j  a v a 2  s .  c om*/
    this.graph = graph;
    // allow for nodes not in graph, but remove them
    this.nodes = Sets.newLinkedHashSet(nodes);
    if (graph != null) {
        this.nodes.retainAll(graph.nodes());
    }
}

From source file:org.gradle.launcher.daemon.server.health.gc.DefaultSlidingWindow.java

@Override
public Set<T> snapshot() {
    lock.lock();/*www.jav  a  2 s . c  om*/
    try {
        return Sets.newLinkedHashSet(deque);
    } finally {
        lock.unlock();
    }
}

From source file:org.jetbrains.jet.lang.types.IntersectionTypeConstructor.java

public IntersectionTypeConstructor(List<AnnotationDescriptor> annotations,
        Collection<JetType> typesToIntersect) {
    super(annotations);
    this.intersectedTypes = Sets.newLinkedHashSet(typesToIntersect);
    this.hashCode = intersectedTypes.hashCode();
}

From source file:guru.qas.martini.jmeter.TagResourceBundle.java

public TagResourceBundle(ResourceBundle delegate, @Nullable Iterable<String> tags) {
    this.delegate = checkNotNull(delegate, "null ResourceBundle");
    this.tags = null == tags ? ImmutableSet.of() : Sets.newLinkedHashSet(tags);
}

From source file:org.jclouds.aws.ec2.compute.suppliers.EC2ImageSupplier.java

@Override
public Set<? extends Image> get() {
    return Sets.newLinkedHashSet(map.get().values());
}

From source file:org.eclipse.sirius.business.internal.session.SessionTransientAttachment.java

/**
 * This utility method look through every adapter associated with the given
 * instance to retrieve, if it is there, any instance of
 * {@link SessionTransientAttachment}./*from ww w .jav a2s.co  m*/
 * 
 * @param eObj
 *            the instance to inspect.
 * @return an optional SessionTransientAttachment.
 */
public static Option<SessionTransientAttachment> getSessionTransientAttachement(Notifier eObj) {
    Iterator<SessionTransientAttachment> it = Iterators
            .filter(Sets.newLinkedHashSet(eObj.eAdapters()).iterator(), SessionTransientAttachment.class);
    if (it.hasNext()) {
        return Options.newSome(it.next());
    }
    return Options.newNone();
}

From source file:org.gradle.api.internal.file.UnionFileTree.java

public UnionFileTree(String displayName, Collection<? extends FileTreeInternal> sourceTrees) {
    this.displayName = displayName;
    this.sourceTrees = Sets.newLinkedHashSet(sourceTrees);
}

From source file:org.isisaddons.wicket.timeline.cpt.ui.TimelineableCollectionAsTimeline.java

@Override
protected Set<String> getTimelineNames(final Collection<ObjectAdapter> entityList) {
    return Sets.newLinkedHashSet(
            Iterables.concat(Iterables.transform(entityList, TimelineableEventProvider.GET_Timeline_NAMES)));
}

From source file:org.isisaddons.wicket.timeline.cpt.ui.TimelineEventableCollectionAsTimeline.java

@Override
protected Set<String> getTimelineNames(final Collection<ObjectAdapter> entityList) {
    return Sets.newLinkedHashSet(
            Iterables.transform(entityList, TimelineEventableEventProvider.GET_Timeline_NAME));
}

From source file:shaded.org.openqa.selenium.remote.server.handler.FindElements.java

@Override
public Set<Map<String, String>> call() throws Exception {
    List<WebElement> elements = getDriver().findElements(by);
    return Sets.newLinkedHashSet(Iterables.transform(elements, new Function<WebElement, Map<String, String>>() {
        public Map<String, String> apply(WebElement element) {
            return ImmutableMap.of("ELEMENT", getKnownElements().add(element));
        }/*from  w  w w  .j  a  v a2  s  .  c  o m*/
    }));
}