本文整理了Java中org.mozilla.javascript.NativeArray.setRawElem()
方法的一些代码示例,展示了NativeArray.setRawElem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NativeArray.setRawElem()
方法的具体详情如下:
包路径:org.mozilla.javascript.NativeArray
类名称:NativeArray
方法名:setRawElem
暂无
代码示例来源:origin: com.github.tntim96/rhino
/**
* See ECMA 15.4.4.4
*/
private static Scriptable js_reverse(Context cx, Scriptable thisObj,
Object[] args)
{
if (thisObj instanceof NativeArray) {
NativeArray na = (NativeArray) thisObj;
if (na.denseOnly) {
for (int i=0, j=((int)na.length)-1; i < j; i++,j--) {
Object temp = na.dense[i];
na.dense[i] = na.dense[j];
na.dense[j] = temp;
}
return thisObj;
}
}
long len = getLengthProperty(cx, thisObj);
long half = len / 2;
for(long i=0; i < half; i++) {
long j = len - i - 1;
Object temp1 = getRawElem(thisObj, i);
Object temp2 = getRawElem(thisObj, j);
setRawElem(cx, thisObj, i, temp2);
setRawElem(cx, thisObj, j, temp1);
}
return thisObj;
}
代码示例来源:origin: io.apigee/rhino
/**
* See ECMA 15.4.4.4
*/
private static Scriptable js_reverse(Context cx, Scriptable thisObj,
Object[] args)
{
if (thisObj instanceof NativeArray) {
NativeArray na = (NativeArray) thisObj;
if (na.denseOnly) {
for (int i=0, j=((int)na.length)-1; i < j; i++,j--) {
Object temp = na.dense[i];
na.dense[i] = na.dense[j];
na.dense[j] = temp;
}
return thisObj;
}
}
long len = getLengthProperty(cx, thisObj);
long half = len / 2;
for(long i=0; i < half; i++) {
long j = len - i - 1;
Object temp1 = getRawElem(thisObj, i);
Object temp2 = getRawElem(thisObj, j);
setRawElem(cx, thisObj, i, temp2);
setRawElem(cx, thisObj, j, temp1);
}
return thisObj;
}
代码示例来源:origin: geogebra/geogebra
/**
* See ECMA 15.4.4.4
*/
private static Scriptable js_reverse(Context cx, Scriptable thisObj,
Object[] args)
{
if (thisObj instanceof NativeArray) {
NativeArray na = (NativeArray) thisObj;
if (na.denseOnly) {
for (int i=0, j=((int)na.length)-1; i < j; i++,j--) {
Object temp = na.dense[i];
na.dense[i] = na.dense[j];
na.dense[j] = temp;
}
return thisObj;
}
}
long len = getLengthProperty(cx, thisObj);
long half = len / 2;
for(long i=0; i < half; i++) {
long j = len - i - 1;
Object temp1 = getRawElem(thisObj, i);
Object temp2 = getRawElem(thisObj, j);
setRawElem(cx, thisObj, i, temp2);
setRawElem(cx, thisObj, j, temp1);
}
return thisObj;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
/**
* See ECMA 15.4.4.4
*/
private static Scriptable js_reverse(Context cx, Scriptable thisObj,
Object[] args)
{
if (thisObj instanceof NativeArray) {
NativeArray na = (NativeArray) thisObj;
if (na.denseOnly) {
for (int i=0, j=((int)na.length)-1; i < j; i++,j--) {
Object temp = na.dense[i];
na.dense[i] = na.dense[j];
na.dense[j] = temp;
}
return thisObj;
}
}
long len = getLengthProperty(cx, thisObj);
long half = len / 2;
for(long i=0; i < half; i++) {
long j = len - i - 1;
Object temp1 = getRawElem(thisObj, i);
Object temp2 = getRawElem(thisObj, j);
setRawElem(cx, thisObj, i, temp2);
setRawElem(cx, thisObj, j, temp1);
}
return thisObj;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
for (i = 1; i <= length; i++) {
Object temp = getRawElem(thisObj, i);
setRawElem(cx, thisObj, i - 1, temp);
代码示例来源:origin: com.github.tntim96/rhino
for (i = 1; i <= length; i++) {
Object temp = getRawElem(thisObj, i);
setRawElem(cx, thisObj, i - 1, temp);
代码示例来源:origin: ro.isdc.wro4j/rhino
setRawElem(cx, thisObj, i, working[i]);
代码示例来源:origin: geogebra/geogebra
for (i = 1; i <= length; i++) {
Object temp = getRawElem(thisObj, i);
setRawElem(cx, thisObj, i - 1, temp);
代码示例来源:origin: io.apigee/rhino
for (i = 1; i <= length; i++) {
Object temp = getRawElem(thisObj, i);
setRawElem(cx, thisObj, i - 1, temp);
代码示例来源:origin: geogebra/geogebra
setRawElem(cx, thisObj, i, working[i]);
代码示例来源:origin: io.apigee/rhino
setRawElem(cx, thisObj, i, working[i]);
代码示例来源:origin: com.github.tntim96/rhino
setRawElem(cx, thisObj, i, working[i]);
代码示例来源:origin: io.apigee/rhino
for (long last = length - 1; last >= 0; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + argc, temp);
代码示例来源:origin: geogebra/geogebra
for (long last = length - 1; last >= 0; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + argc, temp);
代码示例来源:origin: ro.isdc.wro4j/rhino
for (long last = length - 1; last >= 0; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + argc, temp);
代码示例来源:origin: com.github.tntim96/rhino
for (long last = length - 1; last >= 0; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + argc, temp);
代码示例来源:origin: com.github.tntim96/rhino
for (long last = length - 1; last >= end; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + delta, temp);
setRawElem(cx, thisObj, last + delta, temp);
代码示例来源:origin: ro.isdc.wro4j/rhino
for (long last = length - 1; last >= end; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + delta, temp);
setRawElem(cx, thisObj, last + delta, temp);
代码示例来源:origin: io.apigee/rhino
for (long last = length - 1; last >= end; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + delta, temp);
setRawElem(cx, thisObj, last + delta, temp);
代码示例来源:origin: geogebra/geogebra
for (long last = length - 1; last >= end; last--) {
Object temp = getRawElem(thisObj, last);
setRawElem(cx, thisObj, last + delta, temp);
setRawElem(cx, thisObj, last + delta, temp);
内容来源于网络,如有侵权,请联系作者删除!