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


Java Arrays.equals方法代码示例

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


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

示例1: replaceConstructor

import com.sun.squawk.util.Arrays; //导入方法依赖的package包/类
/**
 * Substitutes the body of a given constructor method with the body of a matching method
 * from a set of given replacement methods. A replacement method matches the constructor
 * if it takes the same set of parameter types.
 *
 * @param ctor         the constructor whose body is to be replaced
 * @param replacements the set of methods to search for a match
 * @return the new constructor once the substitution has been done
 * @throws LinkageError if no substitution could be found
 */
private ClassFileMethod replaceConstructor(ClassFileMethod ctor, SquawkVector replacements) {
    if (replacements != null) {

        Klass[] types = ctor.getParameterTypes();
        Klass[] matchTypes = new Klass[types.length + 1];
        System.arraycopy(types, 0, matchTypes, 1, types.length);
        matchTypes[0] = klass;

        for (Enumeration e = replacements.elements(); e.hasMoreElements(); ) {
            ClassFileMethod method = (ClassFileMethod)e.nextElement();

            if (Arrays.equals(matchTypes, method.getParameterTypes())) {
                ctor = new ClassFileMethod("<init>",
                    ctor.getModifiers() | Modifier.METHOD_HAS_PRAGMAS,
                    ctor.getReturnType(),
                    ctor.getParameterTypes(),
                    ctor.getPragmas() | PragmaException.REPLACEMENT_CONSTRUCTOR);
                ctor.setCode(method.getCode());
                return ctor;
            }
        }
    }
    throw new com.sun.squawk.translator.VerifyError(prefix("could not match original constructor with a replacement constructor"));
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:35,代码来源:ClassFileLoader.java

示例2: verifyMethodIsUnique

import com.sun.squawk.util.Arrays; //导入方法依赖的package包/类
/**
 * Verifies that a given method does not match any of the methods in a
 * given collection of methods.
 *
 * @param  methods  the collection of methods to test
 * @param  method   the method to match
 */
private void verifyMethodIsUnique(SquawkVector methods, ClassFileMethod method) {
    for (Enumeration e = methods.elements(); e.hasMoreElements(); ) {
        ClassFileMethod m = (ClassFileMethod)e.nextElement();
        if (m.getName().equals(method.getName()) && Arrays.equals(m.getParameterTypes(), method.getParameterTypes()) && m.getReturnType() == method.getReturnType()) {
            throw cfr.formatError("duplicate method found");
        }
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:16,代码来源:ClassFileLoader.java

示例3: sendArduino

import com.sun.squawk.util.Arrays; //导入方法依赖的package包/类
private void sendArduino(boolean[] blah) {
    //the fuction to send certain data to the arduino
    dummy = blah;
    isSame = Arrays.equals(dummy, lightData);

    if (!isSame) {
        arduinoSignifier.set(true);
        arduinoSignal.set(blah[0]);
        Timer.delay(.01);
        arduinoSignal.set(blah[1]);
        Timer.delay(.01);
        arduinoSignal.set(blah[2]);
        Timer.delay(.01);
        arduinoSignal.set(blah[3]);
        Timer.delay(.01);
        arduinoSignal.set(false);
        arduinoSignifier.set(false);
        Timer.delay(.01);
        System.out.println("hey");
        System.out.println(blah[0]);
        System.out.println(blah[1]);
        System.out.println(blah[2]);
        System.out.println(blah[3]);
    }
    lightData = blah;

}
 
开发者ID:FRCTeam3182,项目名称:FRC2014,代码行数:28,代码来源:ArduinoLights.java


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