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() 

Source Link

Document

Creates a mutable, empty LinkedHashSet instance.

Usage

From source file:com.google.eclipse.mechanic.internal.PreferenceResourceTaskProvider.java

private IResourceTaskProvider get() {
    // This removes duplicates, but ensures insertion order.
    Set<IResourceTaskProvider> providers = Sets.newLinkedHashSet();
    for (IResourceTaskProvider provider : OldMechanicPreferences.getTaskProviders()) {
        providers.add(provider);/*from  ww w  . java2  s  .  c o m*/
    }

    return new CompositeResourceTaskProvider(providers);
}

From source file:de.matzefratze123.heavyspleef.core.event.EventManager.java

public EventManager(Logger logger) {
    this.logger = logger;
    this.registeredEventListeners = Sets.newLinkedHashSet();
}

From source file:org.openscoring.service.NetworkSecurityContext.java

static private Set<String> discoverLocalAddresses() throws IOException {
    Set<String> result = Sets.newLinkedHashSet();

    InetAddress address = InetAddress.getLocalHost();
    result.add(address.getHostAddress());

    InetAddress[] resolvedAddresses = InetAddress.getAllByName("localhost");
    for (InetAddress resolvedAddress : resolvedAddresses) {
        result.add(resolvedAddress.getHostAddress());
    }//from  w w  w  . j a v a  2  s .  co m

    return result;
}

From source file:exec.validate_evaluation.io.ContextIo.java

public Set<Context> read(String zip) {
    Set<Context> contexts = Sets.newLinkedHashSet();
    Directory dir = new Directory(this.root);

    try (IReadingArchive ra = dir.getReadingArchive(zip)) {
        while (ra.hasNext()) {
            contexts.add(ra.getNext(Context.class));
        }/*from w  ww.  j  a  v  a2s . c om*/
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    return contexts;
}

From source file:org.eclipse.sirius.properties.core.internal.PropertiesMetamodelDescriptorProvider.java

@Override
public Collection<MetamodelDescriptor> provides(Collection<Viewpoint> vps) {
    Set<MetamodelDescriptor> result = Sets.newLinkedHashSet();
    result.add(new EcoreMetamodelDescriptor(PropertiesPackage.eINSTANCE));
    return result;
}

From source file:org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaFacetAbstract.java

/**
 * Adds the optional <em>fa</em> and <em>fa-fw</em> FontAwesome classes
 *
 * @param value The original CSS classes defined with {@literal @}
 *            {@link org.apache.isis.applib.annotation.CssClassFa CssClassFa}
 * @return The original CSS classes plus <em>fa</em> and <em>fa-fw</em> if not already provided
 *///  w  w w  . ja v  a 2 s .co m
static String sanitize(final String value) {
    final Iterable<String> classes = Splitter.on(WHITESPACE).split(value.trim());
    final Set<String> cssClassesSet = Sets.newLinkedHashSet();
    cssClassesSet.add("fa");
    cssClassesSet.add("fa-fw");
    for (final String cssClass : classes) {
        cssClassesSet.add(faPrefix(cssClass));
    }
    return Joiner.on(' ').join(cssClassesSet).trim();
}

From source file:net.opentsdb.contrib.tsquare.web.DataQueryModel.java

public DataQueryModel() {
    this.queries = Sets.newLinkedHashSet();
}

From source file:org.eclipse.buildship.core.workspace.internal.BuildCommandUpdater.java

private static Set<? extends ICommand> toCommands(List<OmniEclipseBuildCommand> buildCommands,
        IProjectDescription description) {
    Set<ICommand> result = Sets.newLinkedHashSet();
    for (OmniEclipseBuildCommand buildCommand : buildCommands) {
        result.add(toCommand(description, buildCommand.getName(), buildCommand.getArguments()));
    }//from www. j  a  v a 2s.c  o m
    return result;
}

From source file:com.google.dart.tools.internal.corext.codemanipulation.StubUtility.java

public static String[] getVariableNameSuggestions(Type expectedType, DartExpression assignedExpression,
        Set<String> excluded) {
    Set<String> res = Sets.newLinkedHashSet();
    // use expression
    if (assignedExpression != null) {
        String nameFromExpression = getBaseNameFromExpression(assignedExpression);
        if (nameFromExpression != null) {
            addAll(excluded, res, getVariableNameSuggestions(nameFromExpression));
        }//w  w  w .j a  v a2 s  .c o  m

        String nameFromParent = getBaseNameFromLocationInParent(assignedExpression);
        if (nameFromParent != null) {
            addAll(excluded, res, getVariableNameSuggestions(nameFromParent));
        }
    }
    // use type
    if (expectedType != null && TypeKind.of(expectedType) != TypeKind.DYNAMIC) {
        String typeName = ExtractUtils.getTypeSource(expectedType);
        if ("int".equals(typeName)) {
            addSingleCharacterName(excluded, res, 'i');
        } else if ("double".equals(typeName)) {
            addSingleCharacterName(excluded, res, 'd');
        } else {
            typeName = StringUtils.substringBefore(typeName, "<");
            addAll(excluded, res, getVariableNameSuggestions(typeName));
        }
        res.remove(typeName);
    }
    // done
    return res.toArray(new String[res.size()]);
}

From source file:com.textocat.textokit.morph.ruscorpora.IdentityTagTagger.java

@Override
public void mapFromRusCorpora(RusCorporaWordform srcWf, Wordform targetWf) {
    JCas jCas;//from   w  ww.j ava  2s .co  m
    try {
        jCas = targetWf.getCAS().getJCas();
    } catch (CASException e) {
        throw new RuntimeException(e);
    }
    targetWf.setPos(srcWf.getPos());
    targetWf.setLemma(srcWf.getLex());
    Set<String> resultGrams = Sets.newLinkedHashSet();
    resultGrams.addAll(srcWf.getLexGrammems());
    resultGrams.addAll(srcWf.getWordformGrammems());
    if (!resultGrams.isEmpty()) {
        targetWf.setGrammems(FSUtils.toStringArray(jCas, resultGrams));
    }
}