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.terasology.persistence.typeHandling.gson.GsonPersistedDataMap.java

@Override
public Set<Map.Entry<String, PersistedData>> entrySet() {
    Set<Map.Entry<String, PersistedData>> entries = Sets.newLinkedHashSet();
    for (Map.Entry<String, JsonElement> element : map.entrySet()) {
        entries.add(new AbstractMap.SimpleEntry<String, PersistedData>(element.getKey(),
                new GsonPersistedData(element.getValue())));
    }//from   w  w w  . java  2s. c o m
    return entries;
}

From source file:org.eclipse.moquette.spi.impl.subscriptions.TreeNode.java

/**
 * @return the set of subscriptions for the given client.
 * *//*from  w  w w.j  a  va2s  .  c  o m*/
Set<Subscription> findAllByClientID(String clientID) {
    Map<String, Subscription> subscriptions = subs.row(clientID);
    Set<Subscription> result = Sets.newLinkedHashSet();
    for (Map.Entry<String, Subscription> entry : subscriptions.entrySet()) {
        result.add(entry.getValue());
    }
    return result;
}

From source file:cc.kave.episodes.postprocessor.EpisodesPostprocessor.java

private Set<Episode> getfilteredEp(Map<Set<Fact>, Episode> filtered) {
    Set<Episode> episodes = Sets.newLinkedHashSet();

    for (Map.Entry<Set<Fact>, Episode> entry : filtered.entrySet()) {
        episodes.add(entry.getValue());/*  w  ww .ja  va  2 s. co  m*/
    }
    return episodes;
}

From source file:org.obeonetwork.dsl.uml2.core.internal.listeners.UmlDesignerCoreSessionManagerListener.java

@Override
public void notify(Session updated, int notification) {
    // Nothing// ww w.  j a  va 2 s  .c o m
    if (notification == SessionListener.OPENED) {

        final Set<EPackage> profileEPackages = Sets.newLinkedHashSet();

        for (final Resource semResources : updated.getSemanticResources()) {
            final Iterator<ProfileApplication> it = Iterators
                    .filter(EcoreUtil.getAllProperContents(semResources, true), ProfileApplication.class);
            while (it.hasNext()) {
                final ProfileApplication cur = it.next();
                final EPackage found = cur.getAppliedDefinition();
                if (found != null) {
                    profileEPackages.add(found);
                }
            }
        }
        final Set<MetamodelDescriptor> descriptorsForInterpreter = Sets.newLinkedHashSet();
        for (final EPackage pak : profileEPackages) {
            descriptorsForInterpreter.add(new EcoreMetamodelDescriptor(pak));
        }
        updated.getInterpreter().activateMetamodels(descriptorsForInterpreter);

    }
}

From source file:org.gradle.plugins.ide.internal.tooling.BuildInvocationsBuilder.java

@SuppressWarnings("StringEquality")
public DefaultBuildInvocations buildAll(String modelName, Project project) {
    if (!canBuild(modelName)) {
        throw new GradleException("Unknown model name " + modelName);
    }/*w  w w  . j  av  a2 s. co  m*/

    // construct task selectors
    List<LaunchableGradleTaskSelector> selectors = Lists.newArrayList();
    Map<String, LaunchableGradleTaskSelector> selectorsByName = Maps.newTreeMap(Ordering.natural());
    Set<String> visibleTasks = Sets.newLinkedHashSet();
    findTasks(project, selectorsByName, visibleTasks);
    for (String selectorName : selectorsByName.keySet()) {
        LaunchableGradleTaskSelector selector = selectorsByName.get(selectorName);
        selectors.add(selector.setName(selectorName).setTaskName(selectorName).setProjectPath(project.getPath())
                .setDisplayName(String.format("%s in %s and subprojects.", selectorName, project.toString()))
                .setPublic(visibleTasks.contains(selectorName)));
    }

    // construct project tasks
    List<LaunchableGradleTask> projectTasks = tasks(project);

    // construct build invocations from task selectors and project tasks
    return new DefaultBuildInvocations().setSelectors(selectors).setTasks(projectTasks);
}

From source file:com.intelligentsia.dowsers.entity.meta.provider.MetaEntityProviderComposite.java

@Override
public Collection<MetaEntity> find(final Reference reference) throws NullPointerException {
    Preconditions.checkNotNull(reference);
    final Collection<MetaEntity> result = Sets.newLinkedHashSet();
    for (final MetaEntityProvider provider : metaEntityProviders) {
        result.addAll(provider.find(reference));
    }// ww  w  .ja v  a 2 s. c o m
    return result;
}

From source file:org.terasology.world.propagation.StandardBatchPropagator.java

public StandardBatchPropagator(PropagationRules rules, PropagatorWorldView world) {
    this.world = world;
    this.rules = rules;

    for (Side side : Side.values()) {
        Vector3i delta = new Vector3i(side.getVector3i());
        if (delta.x < 0) {
            delta.x += ChunkConstants.SIZE_X;
        } else if (delta.x > 0) {
            delta.x -= ChunkConstants.SIZE_X;
        }//from  ww  w  .  j a va 2  s.  c o  m
        if (delta.y < 0) {
            delta.y += ChunkConstants.SIZE_Y;
        } else if (delta.y > 0) {
            delta.y -= ChunkConstants.SIZE_Y;
        }
        if (delta.z < 0) {
            delta.z += ChunkConstants.SIZE_Z;
        } else if (delta.z > 0) {
            delta.z -= ChunkConstants.SIZE_Z;
        }
        chunkEdgeDeltas.put(side, delta);
    }

    increaseQueues = new Set[rules.getMaxValue()];
    reduceQueues = new Set[rules.getMaxValue()];
    for (int i = 0; i < rules.getMaxValue(); ++i) {
        increaseQueues[i] = Sets.newLinkedHashSet();
        reduceQueues[i] = Sets.newLinkedHashSet();
    }

}

From source file:com.baidu.rigel.biplatform.ma.model.meta.DimTableMetaDefine.java

/**
 * ?/*ww w. j a  v  a  2s .  c  om*/
 * 
 * @param columns
 *            ?
 */
public void addColumns(List<ColumnMetaDefine> columns) {
    if (columns == null || columns.isEmpty()) {
        return;
    }
    if (this.columns == null) {
        this.columns = Sets.newLinkedHashSet();
    }
    this.columns.addAll(columns);
}

From source file:org.jasig.ssp.factory.reference.impl.ConfidentialityLevelOptionTOFactoryImpl.java

@Override
public Set<ConfidentialityLevelOptionTO> asTOSetOrdered(Collection<DataPermissions> models) {
    Set<ConfidentialityLevelOptionTO> TOs = Sets.newLinkedHashSet();
    for (DataPermissions dataPermissions : models) {
        TOs.add(from(dataPermissions));// w w  w  . ja va2  s  . c  o  m
    }
    return TOs;
}

From source file:org.obeonetwork.dsl.uml2.design.internal.listeners.UmlDesignerSessionManagerListener.java

public void notify(Session updated, int notification) {
    // Nothing//from   ww w. ja  v a 2  s.co  m
    if (notification == SessionListener.OPENED) {

        final Set<EPackage> profileEPackages = Sets.newLinkedHashSet();

        for (final Resource semResources : updated.getSemanticResources()) {
            final Iterator<ProfileApplication> it = Iterators
                    .filter(EcoreUtil.getAllProperContents(semResources, true), ProfileApplication.class);
            while (it.hasNext()) {
                final ProfileApplication cur = it.next();
                final EPackage found = cur.getAppliedDefinition();
                if (found != null) {
                    profileEPackages.add(found);
                }
            }
        }
        final Set<MetamodelDescriptor> descriptorsForInterpreter = Sets.newLinkedHashSet();
        for (final EPackage pak : profileEPackages) {
            descriptorsForInterpreter.add(new EcoreMetamodelDescriptor(pak));
        }
        updated.getInterpreter().activateMetamodels(descriptorsForInterpreter);

    }
}