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(Iterator<? extends E> elements) 

Source Link

Document

Creates a mutable HashSet instance containing the given elements.

Usage

From source file:com.opengamma.bbg.livedata.faketicks.BySchemeFakeSubscriptionSelector.java

public BySchemeFakeSubscriptionSelector(ExternalScheme... toFakes) {
    this(Sets.newHashSet(toFakes));
}

From source file:uk.ac.ebi.atlas.solr.BioentityType.java

public static Set<String> getAllSolrAliases() {
    return Sets.newHashSet(allSolrAliases);
}

From source file:nl.knaw.huygens.timbuctoo.search.CollectionConverter.java

public <E> FilterableSet<E> toFilterableSet(Collection<E> input) {
    Set<E> innerSet = Sets.newHashSet(input);

    return new FilterableSet<E>(innerSet);
}

From source file:buildcraft.core.builders.schematics.SchematicWallSide.java

@Override
public Set<BlockIndex> getPrerequisiteBlocks(IBuilderContext context) {
    final int yPos = 0;
    final int yNeg = 5;
    final int xPos = 2;
    final int xNeg = 1;
    final int zPos = 4;
    final int zNeg = 3;

    switch (meta & 7) {
    case xPos:/*from  www  . j  ava 2s.  c om*/
        return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.EAST.ordinal()]);
    case xNeg:
        return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.WEST.ordinal()]);
    case yPos:
    case 7:
        return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.UP.ordinal()]);
    case yNeg:
    case 6:
        return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.DOWN.ordinal()]);
    case zPos:
        return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.SOUTH.ordinal()]);
    case zNeg:
        return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.NORTH.ordinal()]);
    }
    return null;
}

From source file:com.facebook.buck.apple.xcode.GidGenerator.java

public GidGenerator(Set<String> reservedIds) {
    generatedAndReservedIds = Sets.newHashSet(reservedIds);
}

From source file:org.ingini.mongodb.jongo.example.domain.characters.Heroine.java

public static Heroine addBeast(Heroine heroine, Beast beast) {
    return new Heroine(heroine.getFirstName(), heroine.getLastName(), heroine.getAddress(),
            heroine.getChildren(), Sets.newHashSet(beast), heroine.getWeapon());
}

From source file:com.codereligion.diff.util.StubComparator.java

public StubComparator(final Class<?>... types) {
    this.types = Sets.newHashSet(types);
}

From source file:com.synflow.models.ir.transform.UniqueNameComputer.java

public UniqueNameComputer(Iterable<String> names) {
    this.names = Sets.newHashSet(names);
}

From source file:com.opengamma.web.server.push.analytics.formatting.VolatilitySurfaceFormatter.java

@Override
public String formatForDisplay(VolatilitySurface value, ValueSpecification valueSpec) {
    Surface<Double, Double, Double> inputSurface = value.getSurface();
    if (inputSurface instanceof DoublesSurface) {
        Set<Double> uniqueXValues = Sets.newHashSet(inputSurface.getXData());
        Set<Double> uniqueYValues = Sets.newHashSet(inputSurface.getYData());
        return "Volatility Surface (" + uniqueXValues.size() + " x " + uniqueYValues.size() + ")";
    } else {/* w  w w.j  a  v a 2  s . co  m*/
        s_logger.warn("Unable to format surface of type {}", inputSurface.getClass());
        return null;
    }
}

From source file:com.opengamma.bbg.livedata.faketicks.ByTypeFakeSubscriptionSelector.java

public ByTypeFakeSubscriptionSelector(String... toFakes) {
    this(Sets.newHashSet(toFakes));
}