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


Java Attribute.NOT_CONFIGURABLE属性代码示例

本文整理汇总了Java中jdk.nashorn.internal.objects.annotations.Attribute.NOT_CONFIGURABLE属性的典型用法代码示例。如果您正苦于以下问题:Java Attribute.NOT_CONFIGURABLE属性的具体用法?Java Attribute.NOT_CONFIGURABLE怎么用?Java Attribute.NOT_CONFIGURABLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在jdk.nashorn.internal.objects.annotations.Attribute的用法示例。


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

示例1: length

/**
 * Length getter
 * @param self self reference
 * @return length property value
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
public static Object length(final Object self) {
    if (self instanceof ScriptObject) {
        return JSType.toUint32(((ScriptObject)self).getArray().length());
    }

    return 0;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:NativeRegExpExecResult.java

示例2: length

/**
 * Length getter
 * @param self self reference
 * @return the length of the object
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
public static Object length(final Object self) {
    if (isArray(self)) {
        return JSType.toUint32(((ScriptObject) self).getArray().length());
    }

    return 0;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:NativeArray.java

示例3: length

/**
 * Length getter
 * @param self self reference
 * @return length property value
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
public static Object length(final Object self) {
    if (self instanceof ScriptObject) {
        return (double) JSType.toUint32(((ScriptObject)self).getArray().length());
    }

    return 0;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:NativeRegExpExecResult.java

示例4: length

/**
 * Length getter
 * @param self self reference
 * @return the length of the object
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
public static Object length(final Object self) {
    if (isArray(self)) {
        final long length = ((ScriptObject) self).getArray().length();
        assert length >= 0L;
        // Cast to the narrowest supported numeric type to help optimistic type calculator
        if (length <= Integer.MAX_VALUE) {
            return (int) length;
        }
        return (double) length;
    }

    return 0;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:NativeArray.java

示例5: byteLength

/**
 * Byte length getter as per spec
 * @param self ArrayBufferView instance
 * @return array buffer view length in bytes
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE)
public static int byteLength(final Object self) {
    final ArrayBufferView view = (ArrayBufferView)self;
    return ((TypedArrayData<?>)view.getArray()).getElementLength() * view.bytesPerElement();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:ArrayBufferView.java

示例6: length

/**
 * ECMA 15.5.3 String.length
 * @param self self reference
 * @return     value of length property for string
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE)
public static Object length(final Object self) {
    return getCharSequence(self).length();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:NativeString.java

示例7: buffer

/**
 * Buffer getter as per spec
 * @param self ArrayBufferView instance
 * @return buffer
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE)
public static Object buffer(final Object self) {
    return ((ArrayBufferView)self).buffer;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ArrayBufferView.java

示例8: byteOffset

/**
 * Buffer offset getter as per spec
 * @param self ArrayBufferView instance
 * @return buffer offset
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE)
public static int byteOffset(final Object self) {
    return ((ArrayBufferView)self).byteOffset;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ArrayBufferView.java

示例9: length

/**
 * Length getter as per spec
 * @param self ArrayBufferView instance
 * @return length in elements
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE)
public static int length(final Object self) {
    return ((ArrayBufferView)self).elementLength();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ArrayBufferView.java

示例10: byteLength

/**
 * Byte length for native array buffer
 * @param self native array buffer
 * @return byte length
 */
@Getter(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE)
public static int byteLength(final Object self) {
    return ((NativeArrayBuffer)self).getByteLength();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:NativeArrayBuffer.java

示例11: getProtoLength

/**
 * Prototype length getter
 * @param self self reference
 * @return the length of the object
 */
@Getter(name = "length", where = Where.PROTOTYPE, attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
public static Object getProtoLength(final Object self) {
    return length(self);  // Same as instance getter but we can't make nasgen use the same method for prototype
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:NativeArray.java

示例12: setProtoLength

/**
 * Prototype length setter
 * @param self   self reference
 * @param length new length property
 */
@Setter(name = "length", where = Where.PROTOTYPE, attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
public static void setProtoLength(final Object self, final Object length) {
    length(self, length);  // Same as instance setter but we can't make nasgen use the same method for prototype
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:NativeArray.java


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