当前位置: 首页>>代码示例>>Java>>正文


Java EnumSet.noneOf方法代码示例

本文整理汇总了Java中java.util.EnumSet.noneOf方法的典型用法代码示例。如果您正苦于以下问题:Java EnumSet.noneOf方法的具体用法?Java EnumSet.noneOf怎么用?Java EnumSet.noneOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.EnumSet的用法示例。


在下文中一共展示了EnumSet.noneOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitRequires

import java.util.EnumSet; //导入方法依赖的package包/类
@Override
public void visitRequires(JCRequires tree) {
    ModuleSymbol msym = lookupModule(tree.moduleName);
    if (msym.kind != MDL) {
        log.error(tree.moduleName.pos(), Errors.ModuleNotFound(msym));
        warnedMissing.add(msym);
    } else if (allRequires.contains(msym)) {
        log.error(tree.moduleName.pos(), Errors.DuplicateRequires(msym));
    } else {
        allRequires.add(msym);
        Set<RequiresFlag> flags = EnumSet.noneOf(RequiresFlag.class);
        if (tree.isTransitive)
            flags.add(RequiresFlag.TRANSITIVE);
        if (tree.isStaticPhase)
            flags.add(RequiresFlag.STATIC_PHASE);
        RequiresDirective d = new RequiresDirective(msym, flags);
        tree.directive = d;
        sym.requires = sym.requires.prepend(d);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:Modules.java

示例2: of

import java.util.EnumSet; //导入方法依赖的package包/类
/**
 * Returns a new {@code Collector} described by the given {@code supplier},
 * {@code accumulator}, {@code combiner}, and {@code finisher} functions.
 *
 * @param supplier The supplier function for the new collector
 * @param accumulator The accumulator function for the new collector
 * @param combiner The combiner function for the new collector
 * @param finisher The finisher function for the new collector
 * @param characteristics The collector characteristics for the new
 *                        collector
 * @param <T> The type of input elements for the new collector
 * @param <A> The intermediate accumulation type of the new collector
 * @param <R> The final result type of the new collector
 * @throws NullPointerException if any argument is null
 * @return the new {@code Collector}
 */
public static<T, A, R> Collector<T, A, R> of(Supplier<A> supplier,
                                             BiConsumer<A, T> accumulator,
                                             BinaryOperator<A> combiner,
                                             Function<A, R> finisher,
                                             Characteristics... characteristics) {
    Objects.requireNonNull(supplier);
    Objects.requireNonNull(accumulator);
    Objects.requireNonNull(combiner);
    Objects.requireNonNull(finisher);
    Objects.requireNonNull(characteristics);
    Set<Characteristics> cs = Collectors.CH_NOID;
    if (characteristics.length > 0) {
        cs = EnumSet.noneOf(Characteristics.class);
        Collections.addAll(cs, characteristics);
        cs = Collections.unmodifiableSet(cs);
    }
    return new Collectors.CollectorImpl<>(supplier, accumulator, combiner, finisher, cs);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:35,代码来源:Collector.java

示例3: func_178604_a

import java.util.EnumSet; //导入方法依赖的package包/类
private Set<EnumFacing> func_178604_a(int p_178604_1_)
{
    Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class);
    Queue<Integer> queue = Lists.<Integer>newLinkedList();
    queue.add(IntegerCache.func_181756_a(p_178604_1_));
    this.field_178612_d.set(p_178604_1_, true);

    while (!((Queue)queue).isEmpty())
    {
        int i = ((Integer)queue.poll()).intValue();
        this.func_178610_a(i, set);

        for (EnumFacing enumfacing : EnumFacing.values())
        {
            int j = this.func_178603_a(i, enumfacing);

            if (j >= 0 && !this.field_178612_d.get(j))
            {
                this.field_178612_d.set(j, true);
                queue.add(IntegerCache.func_181756_a(j));
            }
        }
    }

    return set;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:VisGraph.java

示例4: a

import java.util.EnumSet; //导入方法依赖的package包/类
private static Collection<Object> a(Class<?> cls, Type type) {
    if (cls == AbstractCollection.class) {
        return new ArrayList();
    }
    if (cls.isAssignableFrom(HashSet.class)) {
        return new HashSet();
    }
    if (cls.isAssignableFrom(LinkedHashSet.class)) {
        return new LinkedHashSet();
    }
    if (cls.isAssignableFrom(TreeSet.class)) {
        return new TreeSet();
    }
    if (cls.isAssignableFrom(ArrayList.class)) {
        return new ArrayList();
    }
    if (cls.isAssignableFrom(EnumSet.class)) {
        return EnumSet.noneOf(type instanceof ParameterizedType ? ((ParameterizedType) type).getActualTypeArguments()[0] : Object.class);
    }
    try {
        return (Collection) cls.newInstance();
    } catch (Exception e) {
        throw new IllegalArgumentException("create instane error, class " + cls.getName());
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:b.java

示例5: parseDecodeFormats

import java.util.EnumSet; //导入方法依赖的package包/类
private static Set<BarcodeFormat> parseDecodeFormats(Iterable<String> scanFormats, String decodeMode) {
  if (scanFormats != null) {
    Set<BarcodeFormat> formats = EnumSet.noneOf(BarcodeFormat.class);
    try {
      for (String format : scanFormats) {
        formats.add(BarcodeFormat.valueOf(format));
      }
      return formats;
    } catch (IllegalArgumentException iae) {
      // ignore it then
    }
  }
  if (decodeMode != null) {
    return FORMATS_FOR_MODE.get(decodeMode);
  }
  return null;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:18,代码来源:DecodeFormatManager.java

示例6: ImdbSearchCommand

import java.util.EnumSet; //导入方法依赖的package包/类
public ImdbSearchCommand() {
    this.command = "IMDBSearch";
    this.aliases = ImmutableSet.of("SearchIMDB", "SearchTV", "SearchMovies", "SearchMovie");
    this.commandType = CommandType.API;
    this.description = "Search's on imdb by args";
    this.permissions = EnumSet.noneOf(UserPermissions.class);
}
 
开发者ID:ViniciusArnhold,项目名称:ProjectAltaria,代码行数:8,代码来源:ImdbSearchCommand.java

示例7: main

import java.util.EnumSet; //导入方法依赖的package包/类
/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    Bridge.init();
    EnumSet<TestCase> tests = EnumSet.noneOf(TestCase.class);
    for (String arg : args) {
        tests.add(TestCase.valueOf(arg));
    }
    if (args.length == 0) {
        tests = EnumSet.complementOf(EnumSet.of(TestCase.LoadingMain));
    }
    final EnumSet<TestCase> loadingTests =
        EnumSet.of(TestCase.LoadingApplet, TestCase.LoadingMain);
    int testrun = 0;
    for (TestCase test : tests) {
        if (loadingTests.contains(test)) {
            if (testrun > 0) {
                throw new UnsupportedOperationException("Test case "
                      + test + " must be executed first!");
            }
        }
        System.out.println("Testing "+ test+": ");
        System.out.println(test.describe());
        try {
            test.test();
        } catch (Exception x) {
           throw new Error(String.valueOf(test)
               + (System.getSecurityManager() == null ? " without " : " with ")
               + "security failed: "+x+"\n "+"FAILED: "+test.describe()+"\n", x);
        } finally {
            testrun++;
        }
        Bridge.changeContext();
        System.out.println("PASSED: "+ test);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:TestAppletLoggerContext.java

示例8: visitRuleset

import java.util.EnumSet; //导入方法依赖的package包/类
@Override
public void visitRuleset(RulesetTree tree) {
  Set<Combinations> combinations = EnumSet.noneOf(Combinations.class);

  for (PropertyDeclarationTree propertyDeclarationTree : tree.block().propertyDeclarations()) {
    PropertyTree propertyTree = propertyDeclarationTree.property();
    if (isBoxSizing(propertyTree)) {
      combinations.clear();
      combinations.add(Combinations.IS_BOX_SIZING);
    }
    if (!combinations.contains(Combinations.IS_BOX_SIZING)) {
      if (!combinations.contains(Combinations.WIDTH_FOUND) && isWidth(propertyTree)) {
        combinations.add(Combinations.WIDTH_FOUND);
      } else if (!combinations.contains(Combinations.HEIGHT_FOUND) && isHeight(propertyTree)) {
        combinations.add(Combinations.HEIGHT_FOUND);
      }
      if (isWidthSizing(propertyDeclarationTree)) {
        combinations.add(Combinations.WIDTH_SIZING);
      }
      if (isHeightSizing(propertyDeclarationTree)) {
        combinations.add(Combinations.HEIGHT_SIZING);
      }
    }
  }

  if (combinations.containsAll(Arrays.asList(Combinations.WIDTH_FOUND, Combinations.WIDTH_SIZING))
    || combinations.containsAll(Arrays.asList(Combinations.HEIGHT_FOUND, Combinations.HEIGHT_SIZING))) {
    addPreciseIssue(CheckUtils.rulesetIssueLocation(tree), "Check this potential box model size issue.");
  }

  super.visitRuleset(tree);
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:33,代码来源:BewareOfBoxModelCheck.java

示例9: testPreserveNothingOnDirectory

import java.util.EnumSet; //导入方法依赖的package包/类
@Test
public void testPreserveNothingOnDirectory() throws IOException {
  FileSystem fs = FileSystem.get(config);
  EnumSet<FileAttribute> attributes = EnumSet.noneOf(FileAttribute.class);

  Path dst = new Path("/tmp/abc");
  Path src = new Path("/tmp/src");

  createDirectory(fs, src);
  createDirectory(fs, dst);

  fs.setPermission(src, fullPerm);
  fs.setOwner(src, "somebody", "somebody-group");
  fs.setTimes(src, 0, 0);

  fs.setPermission(dst, noPerm);
  fs.setOwner(dst, "nobody", "nobody-group");
  fs.setTimes(dst, 100, 100);

  CopyListingFileStatus srcStatus = new CopyListingFileStatus(fs.getFileStatus(src));

  DistCpUtils.preserve(fs, dst, srcStatus, attributes, false);

  CopyListingFileStatus dstStatus = new CopyListingFileStatus(fs.getFileStatus(dst));

  // FileStatus.equals only compares path field, must explicitly compare all fields
  Assert.assertFalse(srcStatus.getPermission().equals(dstStatus.getPermission()));
  Assert.assertFalse(srcStatus.getOwner().equals(dstStatus.getOwner()));
  Assert.assertFalse(srcStatus.getGroup().equals(dstStatus.getGroup()));
  Assert.assertTrue(dstStatus.getAccessTime() == 100);
  Assert.assertTrue(dstStatus.getModificationTime() == 100);
  Assert.assertTrue(dstStatus.getReplication() == 0);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:TestDistCpUtils.java

示例10: visitAnnotation

import java.util.EnumSet; //导入方法依赖的package包/类
@Override
        public Void visitAnnotation(AnnotationTree tree, EnumSet<UseTypes> d) {
//            System.err.println("tree.getType()= " + tree.toString());
//            System.err.println("tree.getType()= " + tree.getClass());
//        
            TreePath tp = new TreePath(getCurrentPath(), tree.getAnnotationType());
            handlePossibleIdentifier(tp, EnumSet.of(UseTypes.CLASS_USE));
            super.visitAnnotation(tree, EnumSet.noneOf(UseTypes.class));
            //TODO: maybe should be considered
            return null;
        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:SemanticHighlighterBase.java

示例11: getPossibleFlowDirections

import java.util.EnumSet; //导入方法依赖的package包/类
private Set<EnumFacing> getPossibleFlowDirections(World worldIn, BlockPos pos) {
	int i = 1000;
	Set<EnumFacing> set = EnumSet.<EnumFacing> noneOf(EnumFacing.class);

	for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
		EnumFacing enumfacing = (EnumFacing) enumfacing0;
		BlockPos blockpos = pos.offset(enumfacing);
		IBlockState iblockstate = worldIn.getBlockState(blockpos);

		if (!this.isBlocked(worldIn, blockpos, iblockstate)
				&& (iblockstate.getBlock().getMaterial() != this.blockMaterial
						|| ((Integer) iblockstate.getValue(LEVEL)).intValue() > 0)) {
			int j;

			if (this.isBlocked(worldIn, blockpos.down(), worldIn.getBlockState(blockpos.down()))) {
				j = this.func_176374_a(worldIn, blockpos, 1, enumfacing.getOpposite());
			} else {
				j = 0;
			}

			if (j < i) {
				set.clear();
			}

			if (j <= i) {
				set.add(enumfacing);
				i = j;
			}
		}
	}

	return set;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:BlockDynamicLiquid.java

示例12: testIllegalCreate

import java.util.EnumSet; //导入方法依赖的package包/类
public void testIllegalCreate() {
  Collection<Color> empty = EnumSet.noneOf(Color.class);
  try {
    EnumMultiset.create(empty);
    fail();
  } catch (IllegalArgumentException expected) {}
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:8,代码来源:EnumMultisetTest.java

示例13: testFlagsClearSequence

import java.util.EnumSet; //导入方法依赖的package包/类
protected void testFlagsClearSequence(Supplier<StatefulTestOp<Integer>> cf) {
    EnumSet<StreamOpFlag> known = EnumSet.of(StreamOpFlag.ORDERED, StreamOpFlag.SIZED);
    EnumSet<StreamOpFlag> preserve = EnumSet.of(StreamOpFlag.DISTINCT, StreamOpFlag.SORTED);
    EnumSet<StreamOpFlag> notKnown = EnumSet.noneOf(StreamOpFlag.class);

    List<IntermediateTestOp<Integer, Integer>> ops = new ArrayList<>();
    for (StreamOpFlag f : EnumSet.of(StreamOpFlag.ORDERED, StreamOpFlag.DISTINCT, StreamOpFlag.SORTED)) {
        ops.add(cf.get());
        ops.add(new TestFlagExpectedOp<>(f.clear(),
                                         known.clone(),
                                         preserve.clone(),
                                         notKnown.clone()));
        known.remove(f);
        preserve.remove(f);
        notKnown.add(f);
    }
    ops.add(cf.get());
    ops.add(new TestFlagExpectedOp<>(0,
                                     known.clone(),
                                     preserve.clone(),
                                     notKnown.clone()));

    TestData<Integer, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0]));
    @SuppressWarnings("rawtypes")
    IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]);

    withData(data).ops(opsArray).
            without(StreamTestScenario.CLEAR_SIZED_SCENARIOS).
            exercise();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:FlagOpTest.java

示例14: get

import java.util.EnumSet; //导入方法依赖的package包/类
@Override
public Set<V> get() {
  return EnumSet.noneOf(clazz);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:5,代码来源:MultimapBuilder.java

示例15: toEnumSet

import java.util.EnumSet; //导入方法依赖的package包/类
static <E extends Enum<E>> EnumSet<E> toEnumSet(final Class<E> clazz,
    final E... values) {
  final EnumSet<E> set = EnumSet.noneOf(clazz);
  set.addAll(Arrays.asList(values));
  return set;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:EnumSetParam.java


注:本文中的java.util.EnumSet.noneOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。