Java Code Examples for jdk.nashorn.internal.runtime.arrays.ContinuousArrayData#length()

The following examples show how to use jdk.nashorn.internal.runtime.arrays.ContinuousArrayData#length() . 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: NativeArray.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 2
Source File: NativeArray.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static final <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}
 
Example 3
Source File: NativeArray.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 4
Source File: NativeArray.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static final <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}
 
Example 5
Source File: NativeArray.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 6
Source File: NativeArray.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static final <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}
 
Example 7
Source File: NativeArray.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 8
Source File: NativeArray.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static final <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}
 
Example 9
Source File: NativeArray.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 10
Source File: NativeArray.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}
 
Example 11
Source File: NativeArray.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 12
Source File: NativeArray.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static final <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}
 
Example 13
Source File: NativeArray.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
    final ContinuousArrayData data = getContinuousArrayData(self);
    if (data != null) {
        return data.length() == 0 ? null : data;
    }
    return null;
}
 
Example 14
Source File: NativeArray.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static final <T> ContinuousArrayData getContinuousNonEmptyArrayDataCCE(final Object self, final Class<T> clazz) {
    try {
        @SuppressWarnings("unchecked")
        final ContinuousArrayData data = (ContinuousArrayData)(T)((NativeArray)self).getArray();
        if (data.length() != 0L) {
            return data; //if length is 0 we cannot pop and have to relink, because then we'd have to return an undefined, which is a wider type than e.g. int
       }
    } catch (final NullPointerException e) {
        //fallthru
    }
    throw new ClassCastException();
}