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

The following examples show how to use jdk.nashorn.internal.runtime.arrays.ArrayData#getDouble() . 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-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public double getDouble(final Object key, final int programPoint) {
    final Object    primitiveKey = JSType.toPrimitive(key, String.class);
    final int       index        = getArrayIndex(primitiveKey);
    final ArrayData array        = getArray();

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

    return getDouble(index, JSType.toString(primitiveKey), programPoint);
}
 
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 double getDouble(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.getDouble(index);
    }

    return getDouble(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 double getDouble(final int key, final int programPoint) {
    final int       index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(key, programPoint) : array.getDouble(key);
    }

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(key, programPoint) : array.getDouble(key);
    }

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

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

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

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

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

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

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

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(key, programPoint) : array.getDouble(key);
    }

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

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

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

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

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

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(key, programPoint) : array.getDouble(key);
    }

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

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

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

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

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

    return getDouble(key, 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 double getDouble(final int key, final int programPoint) {
    final int       index = getArrayIndex(key);
    final ArrayData array = getArray();

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(key, programPoint) : array.getDouble(key);
    }

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

    if (array.has(index)) {
        return isValid(programPoint) ? array.getDoubleOptimistic(index, programPoint) : array.getDouble(index);
    }

    return getDouble(index, JSType.toString(key), programPoint);
}