本文整理汇总了Java中java.util.EnumSet.clone方法的典型用法代码示例。如果您正苦于以下问题:Java EnumSet.clone方法的具体用法?Java EnumSet.clone怎么用?Java EnumSet.clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.EnumSet
的用法示例。
在下文中一共展示了EnumSet.clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: optimizeMinimizeRegisters
import java.util.EnumSet; //导入方法依赖的package包/类
/**
* Runs the optimizer with a strategy to minimize the number of rop-form
* registers used by the end result. Dex bytecode does not have instruction
* forms that take register numbers larger than 15 for all instructions.
* If we've produced a method that uses more than 16 registers, try again
* with a different strategy to see if we can get under the bar. The end
* result will be much more efficient.
*
* @param rmeth method to process
* @param paramWidth the total width, in register-units, of this method's
* parameters
* @param isStatic true if this method has no 'this' pointer argument.
* @param steps set of optional optimization steps to run
* @return optimized method
*/
private static RopMethod optimizeMinimizeRegisters(RopMethod rmeth,
int paramWidth, boolean isStatic,
EnumSet<OptionalStep> steps) {
SsaMethod ssaMeth;
RopMethod resultMeth;
ssaMeth = SsaConverter.convertToSsaMethod(
rmeth, paramWidth, isStatic);
EnumSet<OptionalStep> newSteps = steps.clone();
/*
* CONST_COLLECTOR trades insns for registers, which is not an
* appropriate strategy here.
*/
newSteps.remove(OptionalStep.CONST_COLLECTOR);
runSsaFormSteps(ssaMeth, newSteps);
resultMeth = SsaToRop.convertToRopMethod(ssaMeth, true);
return resultMeth;
}
示例2: testFlagsSizedOrderedParallelCollect
import java.util.EnumSet; //导入方法依赖的package包/类
public void testFlagsSizedOrderedParallelCollect() {
EnumSet<StreamOpFlag> parKnown = EnumSet.of(StreamOpFlag.SIZED);
EnumSet<StreamOpFlag> serKnown = parKnown.clone();
List<IntermediateTestOp<Integer, Integer>> ops = new ArrayList<>();
for (StreamOpFlag f : parKnown) {
ops.add(CollectorOps.collector());
ops.add(new ParSerTestFlagExpectedOp<>(f.clear(),
parKnown,
serKnown));
serKnown.remove(f);
}
ops.add(CollectorOps.collector());
ops.add(new ParSerTestFlagExpectedOp<>(0,
parKnown,
EnumSet.noneOf(StreamOpFlag.class)));
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).exercise();
}
示例3: MdcInjectionFilter
import java.util.EnumSet; //导入方法依赖的package包/类
/**
* Use this constructor when you want to specify which keys to add to the MDC.
* You could still add custom keys via {@link #setProperty(IoSession, String, String)}
* @param keys set of keys that should be added to the MDC
*
* @see #setProperty(org.apache.mina.core.session.IoSession, String, String)
*/
public MdcInjectionFilter(EnumSet<MdcKey> keys) {
this.mdcKeys = keys.clone();
}