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:org.eclipse.sirius.diagram.business.internal.dialect.DiagramMetamodelsProvider.java

@Override
public Collection<MetamodelDescriptor> provides(Viewpoint vp) {
    Set<MetamodelDescriptor> result = Sets.newLinkedHashSet();
    result.add(new EcoreMetamodelDescriptor(org.eclipse.sirius.diagram.DiagramPackage.eINSTANCE));
    result.add(/*from w  ww.j a v a2  s  . co  m*/
            new EcoreMetamodelDescriptor(org.eclipse.sirius.diagram.description.DescriptionPackage.eINSTANCE));
    result.add(
            new EcoreMetamodelDescriptor(org.eclipse.sirius.diagram.description.style.StylePackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(org.eclipse.sirius.diagram.description.tool.ToolPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.diagram.description.filter.FilterPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.diagram.description.concern.ConcernPackage.eINSTANCE));
    return result;
}

From source file:org.quickgeo.PostalDbFactory.java

/**
 * Builds a new PostalDb instance, with all postal data stored in memory.  This process
 * is somewhat resource intensive and should only be done once per application
 * instance. Given that {@link PostalDb} instances are immutable, the instance should 
 * be freely shared among threads.//  ww  w.  j  a va  2 s.  c  o  m
 * 
 * @return A new PostalDb instance.
 * @since 0.1.0
 */
private static PostalDb build() {

    LinkedHashSet<Place> set = Sets.newLinkedHashSet();

    for (PostalSource source : SERVICE_LOADER) {
        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(source.getStream()));
            String line = null;

            while ((line = in.readLine()) != null) {
                try {
                    Place p = PlaceFactory.fromLine(line);
                    set.add(p);
                } catch (Exception ex) {
                    Logger.getLogger(PostalDbFactory.class.getName()).log(Level.INFO,
                            "Couldn''t read line : {0}", ex.getMessage());
                }
            }
            in.close();
        } catch (Exception ex) {
            Logger.getLogger(PostalDbFactory.class.getName()).log(Level.INFO, "Couldn''t read source : {0}",
                    ex.getMessage());
        }
    }

    return new PostalDb(set);
}

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

private static Set<? extends String> toNatures(List<OmniEclipseProjectNature> projectNatures) {
    Set<String> natures = Sets.newLinkedHashSet();
    for (OmniEclipseProjectNature projectNature : projectNatures) {
        String id = projectNature.getId();
        if (CorePlugin.workspaceOperations().isNatureRecognizedByEclipse(id)) {
            natures.add(id);/*from   w  ww  . ja  v a 2 s  .c  o m*/
        }
    }
    return natures;
}

From source file:org.eclipse.sirius.business.internal.dialect.ViewpointMetamodelsProvider.java

@Override
public Collection<MetamodelDescriptor> provides(Collection<Viewpoint> vp) {
    Set<MetamodelDescriptor> result = Sets.newLinkedHashSet();
    result.add(new EcoreMetamodelDescriptor(org.eclipse.sirius.viewpoint.ViewpointPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.viewpoint.description.DescriptionPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.viewpoint.description.style.StylePackage.eINSTANCE));
    result.add(//ww  w  . j  a v  a  2 s. c  om
            new EcoreMetamodelDescriptor(org.eclipse.sirius.viewpoint.description.tool.ToolPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.viewpoint.description.validation.ValidationPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.viewpoint.description.audit.AuditPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.description.contribution.ContributionPackage.eINSTANCE));
    return result;
}

From source file:com.dilipkumarg.qb.core.JoinClauseBuilder.java

public JoinClauseBuilder() {
    this.joinConditions = Sets.newLinkedHashSet();
}

From source file:org.nanoframework.core.component.scan.ComponentScan.java

/**
 * ?// ww  w  .  j  a  v  a 2 s  .  co  m
 * @param annotationClass 
 * @return ?
 */
public static Set<Class<?>> filter(final Class<? extends Annotation> annotationClass) {
    if (classes == null) {
        classes = Sets.newLinkedHashSet();
    }

    if (classes.size() > 0) {
        final Set<Class<?>> annClasses = Sets.newLinkedHashSet();
        classes.stream().filter(clz -> clz.isAnnotationPresent(annotationClass))
                .forEach(clz -> annClasses.add(clz));
        return annClasses;

    }

    return Collections.emptySet();
}

From source file:de.tu_berlin.dima.oligos.DenseSchema.java

public DenseSchema() {
    columns = Sets.newLinkedHashSet();
}

From source file:org.eclipse.sirius.diagram.sequence.business.internal.metamodel.SequenceDiagramMetamodelsProvider.java

@Override
public Collection<MetamodelDescriptor> provides(Collection<Viewpoint> vp) {
    Set<MetamodelDescriptor> result = Sets.newLinkedHashSet();
    result.add(new EcoreMetamodelDescriptor(org.eclipse.sirius.diagram.sequence.SequencePackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.diagram.sequence.description.DescriptionPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.diagram.sequence.description.tool.ToolPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.diagram.sequence.ordering.OrderingPackage.eINSTANCE));
    result.add(new EcoreMetamodelDescriptor(
            org.eclipse.sirius.diagram.sequence.template.TemplatePackage.eINSTANCE));
    return result;
}

From source file:nextmethod.codedom.CodePackageImportCollection.java

public CodePackageImportCollection() {
    data = Sets.newLinkedHashSet();
    keys = Maps.newHashMap();
}

From source file:org.jclouds.ecs.compute.suppliers.EcsHardwareSupplier.java

@Override
public Set<? extends Hardware> get() {
    // TODO Auto-generated method stub
    return Sets.newLinkedHashSet();
}