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

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

Introduction

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

Prototype


@GwtCompatible(serializable = true)
public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(Iterable<E> elements) 

Source Link

Document

Returns an immutable set instance containing the given enum elements.

Usage

From source file:com.google.javascript.jscomp.fuzzing.ArrayFuzzer.java

@Override
protected Set<Type> supportedTypes() {
    return Sets.immutableEnumSet(Type.ARRAY);
}

From source file:com.tngtech.archunit.core.domain.JavaModifier.java

JavaModifier(Set<ApplicableType> applicableTo, int asmAccessFlag) {
    this.applicableTo = Sets.immutableEnumSet(applicableTo);
    this.asmAccessFlag = asmAccessFlag;
}

From source file:org.caleydo.view.domino.internal.tourguide.StratificationTourGuideDataMode.java

@Override
public Iterable<? extends ADataDomainQuery> createDataDomainQuery(IDataDomain dd) {
    if (dd instanceof PathwayDataDomain)
        return Arrays.asList(new PathwaySetDataDomainQuery());
    if (!DataSupportDefinitions.homogenousTables.apply(dd))
        // inhomogenous categorical just them
        return Collections.singleton(new InhomogenousDataDomainQuery((ATableBasedDataDomain) dd,
                Sets.immutableEnumSet(EDataClass.CATEGORICAL)));
    if (DataSupportDefinitions.categoricalTables.apply(dd)) {
        return Arrays.asList(new CategoricalDataDomainQuery((ATableBasedDataDomain) dd, EDimension.DIMENSION),
                new CategoricalDataDomainQuery((ATableBasedDataDomain) dd, EDimension.RECORD));
    }/*from   www.  j  a  va2 s . c o m*/
    return Arrays.asList(new StratificationDataDomainQuery((ATableBasedDataDomain) dd, EDimension.DIMENSION),
            new StratificationDataDomainQuery((ATableBasedDataDomain) dd, EDimension.RECORD));
}

From source file:org.caleydo.view.tourguide.internal.adapter.StratificationDataMode.java

@Override
public boolean apply(IDataDomain dataDomain) {
    if (!(dataDomain instanceof ATableBasedDataDomain))
        return false;
    if (!((ATableBasedDataDomain) dataDomain).getTable().isDataHomogeneous())
        return InhomogenousDataDomainQuery.hasOne(dataDomain, Sets.immutableEnumSet(EDataClass.CATEGORICAL));
    return true;/* ww  w.  j a va 2 s.  c om*/
}

From source file:org.trnltk.morphology.contextless.parser.SuffixFormGraph.java

public SuffixFormGraphNode addNode(SuffixFormGraphNodeKey suffixFormGraphNodeKey,
        SuffixGraphStateType suffixGraphStateType, Set<PhoneticAttribute> phonAttrSet) {
    final SuffixFormGraphNode suffixFormGraphNode = new SuffixFormGraphNode(suffixFormGraphNodeKey,
            suffixGraphStateType, Sets.immutableEnumSet(phonAttrSet));
    final SuffixFormGraphNode existingSuffixFormGraphNode = this.nodeMap.put(suffixFormGraphNodeKey,
            suffixFormGraphNode);/*from   www  . j  a  v  a 2  s  . c o m*/
    Validate.isTrue(existingSuffixFormGraphNode == null);

    return suffixFormGraphNode;
}

From source file:de.adrodoc55.minecraft.mpl.compilation.CompilerOptions.java

public CompilerOptions(Iterable<CompilerOption> options) {
    this.options = Sets.immutableEnumSet(options);
}

From source file:com.tngtech.archunit.core.domain.JavaModifier.java

private static Set<JavaModifier> getModifiersFor(ApplicableType type, int asmAccess) {
    Set<JavaModifier> result = new HashSet<>();
    for (JavaModifier modifier : JavaModifier.values()) {
        if (modifier.applicableTo.contains(type) && modifierPresent(modifier, asmAccess)) {
            result.add(modifier);//from   w w  w .  j  av  a2s.  c o m
        }
    }
    return result.isEmpty() ? Collections.<JavaModifier>emptySet() : Sets.immutableEnumSet(result);
}

From source file:com.google.javascript.jscomp.fuzzing.Dispatcher.java

@Override
protected Set<Type> supportedTypes() {
    if (supportedTypes == null) {
        supportedTypes = EnumSet.noneOf(Type.class);
        for (AbstractFuzzer fuzzer : getCandidates()) {
            supportedTypes.addAll(fuzzer.supportedTypes());
        }//from w w w  . j a v a 2 s .  co m
    }
    return Sets.immutableEnumSet(supportedTypes);
}

From source file:com.google.javascript.jscomp.fuzzing.WhileFuzzer.java

@Override
protected Node fuzz(AbstractFuzzer fuzzer, int budget) {
    if (fuzzer instanceof ExpressionFuzzer) {
        /*/* w  w w  .  j  a v  a2 s  . co m*/
         * someLabel: while(void(xxx)) {} often causes compiler to crash when
         * compiling from AST. Because while(undefined) {} only produce dead code,
         * we could safely remove it.
         */
        Set<Type> types = Sets
                .immutableEnumSet(Sets.difference(fuzzer.supportedTypes(), EnumSet.of(Type.UNDEFINED)));
        return fuzzer.generate(budget, types);
    } else {
        return fuzzer.generate(budget);
    }
}

From source file:org.trnltk.morphology.morphotactics.suffixformspecifications.SuffixFormSpecifications.java

public static Specification<MorphemeContainer> doesntHaveLexemeAttributes(LexemeAttribute... lexemeAttributes) {
    return new DoesntHaveLexemeAttributes(Sets.immutableEnumSet(Arrays.asList(lexemeAttributes)));
}