Java Code Examples for jdk.nashorn.internal.objects.annotations.Attribute.NOT_WRITABLE

The following are Jave code examples for showing how to use NOT_WRITABLE of the jdk.nashorn.internal.objects.annotations.Attribute class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: OpenJSharp   File: ArrayBufferView.java   Source Code and License Vote up 4 votes
/**
 * 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();
}
 
Example 2
Project: openjdk-jdk10   File: ArrayBufferView.java   Source Code and License Vote up 4 votes
/**
 * 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();
}
 
Example 3
Project: OpenJSharp   File: NativeString.java   Source Code and License Vote up 2 votes
/**
 * 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();
}
 
Example 4
Project: OpenJSharp   File: ArrayBufferView.java   Source Code and License Vote up 2 votes
/**
 * 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;
}
 
Example 5
Project: OpenJSharp   File: ArrayBufferView.java   Source Code and License Vote up 2 votes
/**
 * 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;
}
 
Example 6
Project: OpenJSharp   File: ArrayBufferView.java   Source Code and License Vote up 2 votes
/**
 * 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();
}
 
Example 7
Project: OpenJSharp   File: NativeArrayBuffer.java   Source Code and License Vote up 2 votes
/**
 * 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();
}
 
Example 8
Project: openjdk-jdk10   File: NativeString.java   Source Code and License Vote up 2 votes
/**
 * 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();
}
 
Example 9
Project: openjdk-jdk10   File: ArrayBufferView.java   Source Code and License Vote up 2 votes
/**
 * 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;
}
 
Example 10
Project: openjdk-jdk10   File: ArrayBufferView.java   Source Code and License Vote up 2 votes
/**
 * 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;
}
 
Example 11
Project: openjdk-jdk10   File: ArrayBufferView.java   Source Code and License Vote up 2 votes
/**
 * 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();
}
 
Example 12
Project: openjdk-jdk10   File: NativeArrayBuffer.java   Source Code and License Vote up 2 votes
/**
 * 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();
}