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

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

Introduction

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

Prototype

public static <E> HashSet<E> newHashSet() 

Source Link

Document

Creates a mutable, initially empty HashSet instance.

Usage

From source file:cuchaz.m3l.classTransformation.HookInjector.java

public HookInjector(HookLibrary library) {
    m_library = library;/*from w  w  w . j av  a 2  s.  c o m*/

    // build a list of the hooked class names
    m_hookedClassEntries = Sets.newHashSet();
    for (ClassHook hook : m_library.classHooks()) {
        m_hookedClassEntries.add(hook.getClassEntry());
    }
    for (BehaviorHook hook : m_library.methodHooks()) {
        m_hookedClassEntries.add(hook.getBehaviorEntry().getClassEntry());
    }
}

From source file:com.b2international.snowowl.datastore.importer.TerminologyImportValidationDefect.java

public TerminologyImportValidationDefect(final String sheetName) {
    this.sheetName = sheetName;
    this.defects = Sets.newHashSet();
}

From source file:com.theoriginalbit.moarperipherals.common.network.PacketHandler.java

public static Set<EntityPlayer> getPlayersWatchingChunk(WorldServer world, int chunkX, int chunkZ) {
    final PlayerManager manager = world.getPlayerManager();

    final Set<EntityPlayer> playerList = Sets.newHashSet();
    for (Object o : world.playerEntities) {
        EntityPlayerMP player = (EntityPlayerMP) o;
        if (manager.isPlayerWatchingChunk(player, chunkX, chunkZ))
            playerList.add(player);// www  .  j  av a2  s  .  com
    }
    return playerList;
}

From source file:com.android.tools.idea.experimental.codeanalysis.datastructs.graph.node.impl.DummyNodeImpl.java

public DummyNodeImpl(BlockGraph parentGraph) {
    this.mBlockGraph = parentGraph;
    this.mInNodes = Sets.newHashSet();
    this.mOutNodes = Sets.newHashSet();
    this.mStmtList = null;
}

From source file:cuchaz.enigma.convert.ClassMatch.java

public ClassMatch(ClassEntry sourceClass, ClassEntry destClass) {
    sourceClasses = Sets.newHashSet();
    if (sourceClass != null) {
        sourceClasses.add(sourceClass);/*from  w ww . j a va  2  s.  c o  m*/
    }
    destClasses = Sets.newHashSet();
    if (destClass != null) {
        destClasses.add(destClass);
    }
}

From source file:com.netflix.genie.web.util.MetricsUtils.java

/**
 * Convenience method that creates a tag set pre-populated with failure status and exception details.
 *
 * @param t the exception/*  w  ww.j av a  2  s.c om*/
 * @return a new set containing failure tags
 */
public static Set<Tag> newFailureTagsSetForException(final Throwable t) {
    final Set<Tag> tags = Sets.newHashSet();
    addFailureTagsWithException(tags, t);
    return tags;
}

From source file:org.gradle.internal.authentication.AbstractAuthentication.java

public AbstractAuthentication(String name) {
    this.name = name;
    this.supportedCredentials = Sets.newHashSet();
}

From source file:interactivespaces.master.resource.deployment.internal.ObrFeatureBundleResolver.java

@Override
public Set<String> getDependencies(Collection<Feature> features) {
    Set<String> dependencies = Sets.newHashSet();

    // TODO(keith): Eventually this should look inside the bundles and see what
    // they need/*from   ww  w  .  ja va  2  s  .co m*/
    // and figure out the whole graph.
    for (Feature feature : features) {
        dependencies.addAll(feature.getRootBundles());
    }

    return dependencies;
}

From source file:com.b2international.snowowl.datastore.importer.TerminologyImportResult.java

public TerminologyImportResult() {
    visitedComponentIds = Sets.newHashSet();
    validationDefects = Sets.newHashSet();
}

From source file:com.android.tools.idea.updater.configure.SummaryTreeNode.java

/**
 * Factory method to create SummaryTreeNodes.
 *
 * @param version The AndroidVersion of this node
 * @param children The nodes represented by this summary node.
 * @param versionName The version name to be shown in the UI.
 * @return A new SummaryTreeNode, or null if none of the children are actually included.
 */// ww w  . ja  v  a  2  s.  c  o  m
public static SummaryTreeNode createNode(AndroidVersion version, Set<UpdaterTreeNode> children) {
    Set<UpdaterTreeNode> includedChildren = Sets.newHashSet();
    UpdaterTreeNode primaryChild = null;
    for (UpdaterTreeNode child : children) {
        if (child.includeInSummary()) {
            includedChildren.add(child);
        }
        if (child.isPrimary()) {
            primaryChild = child;
        }
    }

    if (!includedChildren.isEmpty()) {
        return new SummaryTreeNode(version, children, includedChildren, primaryChild);
    }
    return null;
}