當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumSet.clone方法代碼示例

本文整理匯總了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;
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:38,代碼來源:Optimizer.java

示例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();
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:24,代碼來源:FlagOpTest.java

示例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();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:11,代碼來源:MdcInjectionFilter.java


注:本文中的java.util.EnumSet.clone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。