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


Java Vm2c类代码示例

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


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

示例1: grow

import com.sun.squawk.Vm2c; //导入依赖的package包/类
/**
     * Grows the bit set.
     *
     * @param bitIndex       the index of the bit being accessed that caused the growth
     * @param bytesRequired  the minimum new size
     * @throws IndexOutOfBoundsException if this is an {@link #areBitsExternal() external}
     *              BitSet instance and <code>bitIndex >= this.size()</code>
     */
/*if[JAVA5SYNTAX]*/
    @Vm2c(code="fatalVMError(\"cannot grow bit set\");")
/*end[JAVA5SYNTAX]*/
    private void grow(int bitIndex, int bytesRequired) throws IndexOutOfBoundsException {
        // Cannot grow a bit set whose bits are external
        if (bitsAreExternal) {
            throw new IndexOutOfBoundsException();
        }

        // Allocate larger of doubled size or required size
        int request = Math.max(2 * bits.length, bytesRequired);
        byte newBits[] = new byte[request];
        System.arraycopy(bits, 0, newBits, 0, bytesInUse);
        bits = newBits;
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:24,代码来源:BitSet.java

示例2: grow

import com.sun.squawk.Vm2c; //导入依赖的package包/类
/**
 * Grows the bit set.
 *
 * @param bitIndex       the index of the bit being accessed that caused the growth
 * @param bytesRequired  the minimum new size
 * @throws IndexOutOfBoundsException if this is an {@link #areBitsExternal() external}
 *              BitSet instance and <code>bitIndex >= this.size()</code>
 */

@Vm2c(code="fatalVMError(\"cannot grow bit set\");")

private void grow(int bitIndex, int bytesRequired) throws IndexOutOfBoundsException {
    // Cannot grow a bit set whose bits are external
    if (bitsAreExternal) {
        throw new IndexOutOfBoundsException();
    }

    // Allocate larger of doubled size or required size
    int request = Math.max(2 * bits.length, bytesRequired);
    byte newBits[] = new byte[request];
    System.arraycopy(bits, 0, newBits, 0, bytesInUse);
    bits = newBits;
}
 
开发者ID:sics-sse,项目名称:moped,代码行数:24,代码来源:BitSet.java


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