Java Code Examples for jdk.nashorn.internal.runtime.arrays.ArrayData#getObject()

The following examples show how to use jdk.nashorn.internal.runtime.arrays.ArrayData#getObject() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScriptObject.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 2
Source File: ScriptObject.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final Object key) {
    final Object primitiveKey = JSType.toPrimitive(key, String.class);
    final int index = getArrayIndex(primitiveKey);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(primitiveKey));
}
 
Example 3
Source File: ScriptObject.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final int key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 4
Source File: ScriptObject.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 5
Source File: ScriptObject.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final Object key) {
    final Object    primitiveKey = JSType.toPrimitive(key, String.class);
    final int       index        = getArrayIndex(primitiveKey);
    final ArrayData array        = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(primitiveKey));
}
 
Example 6
Source File: ScriptObject.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final int key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 7
Source File: ScriptObject.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final long key) {
    final int index = ArrayIndex.getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 8
Source File: ScriptObject.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final Object key) {
    final Object    primitiveKey = JSType.toPrimitive(key, String.class);
    final int       index        = getArrayIndex(primitiveKey);
    final ArrayData array        = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(primitiveKey));
}
 
Example 9
Source File: ScriptObject.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final Object key) {
    final int index = ArrayIndex.getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 10
Source File: ScriptObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 11
Source File: ScriptObject.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final Object key) {
    final Object primitiveKey = JSType.toPrimitive(key, String.class);
    final int index = getArrayIndex(primitiveKey);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(primitiveKey));
}
 
Example 12
Source File: ScriptObject.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final int key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 13
Source File: ScriptObject.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 14
Source File: ScriptObject.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final Object key) {
    final Object    primitiveKey = JSType.toPrimitive(key, String.class);
    final int       index        = getArrayIndex(primitiveKey);
    final ArrayData array        = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(primitiveKey));
}
 
Example 15
Source File: ScriptObject.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final int key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 16
Source File: ScriptObject.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final int key) {
    final ArrayData array = getArray();

    if (array.has(key)) {
        return array.getObject(key);
    }

    return get(key, JSType.toString(key));
}
 
Example 17
Source File: ScriptObject.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 18
Source File: ScriptObject.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 19
Source File: ScriptObject.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final int key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}
 
Example 20
Source File: ScriptObject.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(final double key) {
    final int index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return array.getObject(index);
    }

    return get(index, JSType.toString(key));
}