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:org.isisaddons.wicket.fullcalendar2.cpt.ui.CalendarableCollectionAsFullCalendar2.java

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

From source file:org.isisaddons.wicket.fullcalendar2.cpt.ui.CalendarEventableCollectionAsFullCalendar2.java

@Override
protected Set<String> getCalendarNames(final Collection<ObjectAdapter> entityList) {
    return Sets.newLinkedHashSet(
            Iterables.transform(entityList, CalendarEventableEventProvider.GET_CALENDAR_NAME));
}

From source file:at.molindo.esi4j.multi.impl.DefaultMultiIndexManager.java

/**
 * rebuild supported types per wrapped index
 *//*from  w  w  w  . j a v  a 2  s.  com*/
@Override
public void rebuild(Class<?>... types) {
    for (InternalIndex index : getIndex().getIndices().values()) {

        LinkedHashSet<Class<?>> typeSet = Sets.newLinkedHashSet(Arrays.asList(types));
        typeSet.retainAll(Arrays.asList(index.getIndexManager().getTypes()));

        Class<?>[] managedTypes = typeSet.toArray(new Class<?>[typeSet.size()]);

        index.getIndexManager().rebuild(managedTypes);
    }

}

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

public static void addGrammemes(JCas jCas, Wordform wf, Iterable<String> newGrams) {
    LinkedHashSet<String> wfGrams = Sets.newLinkedHashSet(FSUtils.toSet(wf.getGrammems()));
    boolean changed = false;
    for (String newGram : newGrams) {
        changed |= wfGrams.add(newGram);
    }//from w ww  .j  a v  a2 s . co m
    if (changed) {
        wf.setGrammems(FSUtils.toStringArray(jCas, wfGrams));
    }
}

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

@Override
public Set<Map<String, String>> call() throws Exception {
    List<WebElement> elements = getElement().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));
        }//  ww  w . j a  va2s  .c  o m
    }));
}

From source file:org.obiba.mica.core.domain.DocumentSet.java

public void setIdentifiers(List<String> identifiers) {
    this.identifiers = Sets.newLinkedHashSet(identifiers);
}

From source file:org.terasology.persistence.typeHandling.coreTypes.SetTypeHandler.java

@Override
public Set<T> deserialize(PersistedData data, DeserializationContext context) {
    return Sets.newLinkedHashSet(contentsHandler.deserializeCollection(data, context));
}

From source file:org.sonar.api.workflow.condition.StatusCondition.java

public StatusCondition(String... statuses) {
    this(Sets.newLinkedHashSet(Arrays.asList(statuses)));
}

From source file:org.jclouds.atmos.domain.UserMetadata.java

public UserMetadata(Map<String, String> metadata, Map<String, String> listableMetadata, Iterable<String> tags,
        Iterable<String> listableTags) {
    this.metadata = Maps.newLinkedHashMap(checkNotNull(metadata, "metadata"));
    this.listableMetadata = Maps.newLinkedHashMap(checkNotNull(listableMetadata, "listableMetadata"));
    this.tags = Sets.newLinkedHashSet(checkNotNull(tags, "tags"));
    this.listableTags = Sets.newLinkedHashSet(checkNotNull(listableTags, "listableTags"));
}

From source file:cc.gospy.core.pipeline.Pipelines.java

public <T> Collection<Pipeline> get(Class<T> resultType) throws PipelineNotFoundException {
    Set<Pipeline> activatedPipelines = Sets.newLinkedHashSet(this.pipelines.get(resultType));
    if (resultType != Object.class) {
        // add universal pipelines
        activatedPipelines.addAll(this.pipelines.get(Object.class));
    }//from  www  .j a v  a2 s.co m
    return activatedPipelines;
}