本文整理匯總了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();
}