本文整理汇总了Java中jdk.nashorn.internal.objects.annotations.Attribute.NOT_WRITABLE属性的典型用法代码示例。如果您正苦于以下问题:Java Attribute.NOT_WRITABLE属性的具体用法?Java Attribute.NOT_WRITABLE怎么用?Java Attribute.NOT_WRITABLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类jdk.nashorn.internal.objects.annotations.Attribute
的用法示例。
在下文中一共展示了Attribute.NOT_WRITABLE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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;
}
示例4: 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;
}
示例5: 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();
}
示例6: 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();
}