Java 类com.google.gwt.core.client.JsArrayBoolean 实例源码

项目:gwt-jui    文件:JsArrayUtil.java   
public static JsArrayBoolean fromBooleans(Collection<Boolean> collection) {
    JsArrayBoolean array = JsArrayBoolean.createArray().cast();
    for(Boolean item : collection) {
        array.push(item);
    }
    return array;
}
项目:gwt-jui    文件:JsArrayUtil.java   
public static List<Boolean> toList(JsArrayBoolean array) {
    List<Boolean> list = new ArrayList<>();
    if(array != null) {
        for (int i = 0; i < array.length(); i++) {
            list.add(array.get(i));
        }
    }
    return list;
}
项目:turbogwt-core    文件:JsArrays.java   
public static JsArrayBoolean fromArray(boolean... values) {
    if (GWT.isScript()) {
        return reinterpretCast(values);
    } else {
        JsArrayBoolean ret = JavaScriptObject.createArray().cast();
        for (int i = 0, l = values.length; i < l; i++) {
            ret.set(i, values[i]);
        }
        return ret;
    }
}
项目:turbogwt-core    文件:JsArrays.java   
public static boolean[] toArray(JsArrayBoolean values) {
    if (GWT.isScript()) {
        return reinterpretCast(values);
    } else {
        int length = values.length();
        boolean[] ret = new boolean[length];
        for (int i = 0, l = length; i < l; i++) {
            ret[i] = values.get(i);
        }
        return ret;
    }
}
项目:turbogwt    文件:JsArrays.java   
public static JsArrayBoolean fromArray(boolean... values) {
    if (GWT.isScript()) {
        return reinterpretCast(values);
    } else {
        JsArrayBoolean ret = JavaScriptObject.createArray().cast();
        for (int i = 0, l = values.length; i < l; i++) {
            ret.set(i, values[i]);
        }
        return ret;
    }
}
项目:turbogwt    文件:JsArrays.java   
public static boolean[] toArray(JsArrayBoolean values) {
    if (GWT.isScript()) {
        return reinterpretCast(values);
    } else {
        int length = values.length();
        boolean[] ret = new boolean[length];
        for (int i = 0, l = length; i < l; i++) {
            ret[i] = values.get(i);
        }
        return ret;
    }
}
项目:gwittir    文件:JsArrayUtil.java   
/**
 * Wraps a Java boolean Array to a JsArrayBoolean for dev mode.
 * 
 * @param srcArray the array to wrap
 * @return the wrapped array
 */
public static JsArrayBoolean wrapArray(boolean[] srcArray) {
    JsArrayBoolean result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
        result.set(i, srcArray[i]);
    }
    return result;
}
项目:gwtcc-gwtgl    文件:JsArrayUtil.java   
/**
 * Wraps a Java boolean Array to a JsArrayBoolean.
 * 
 * @param srcArray the array to wrap
 * @return the wrapped array
 */
public static JsArrayBoolean wrapArray(boolean[] srcArray) {
  if (GWT.isScript()) {
    return arrayAsJsArrayForProdMode(srcArray);
  }
  JsArrayBoolean result = JavaScriptObject.createArray().cast();
  for (int i = 0; i < srcArray.length; i++) {
    result.set(i, srcArray[i]);
  }
  return result;
}
项目:turbogwt-core    文件:JsArrayIterator.java   
public JsArrayIterator(JsArrayBoolean array) {
    this((JavaScriptObject) array);
}
项目:turbogwt-core    文件:JsArrays.java   
private static native JsArrayBoolean reinterpretCast(boolean[] value) /*-{
    return value;
}-*/;
项目:turbogwt-core    文件:JsArrays.java   
private static native boolean[] reinterpretCast(JsArrayBoolean value) /*-{
    return value;
}-*/;
项目:turbogwt    文件:JsArrayIterator.java   
public JsArrayIterator(JsArrayBoolean array) {
    this((JavaScriptObject) array);
}
项目:turbogwt    文件:JsArrays.java   
private static native JsArrayBoolean reinterpretCast(boolean[] value) /*-{
    return value;
}-*/;
项目:turbogwt    文件:JsArrays.java   
private static native boolean[] reinterpretCast(JsArrayBoolean value) /*-{
    return value;
}-*/;
项目:Wiab.pro    文件:JsArraySort.java   
/**
 * Sorts a JsArray of booleans.
 *
 * @param sortMe Array to be sorted.
 * @param comparator Comparator to be used, per native JS sort() method.
 */
public static native void sort(JsArrayBoolean sortMe, JavaScriptObject comparator) /*-{
  sortMe.sort(comparator);
}-*/;
项目:incubator-wave    文件:JsArraySort.java   
/**
 * Sorts a JsArray of booleans.
 *
 * @param sortMe Array to be sorted.
 * @param comparator Comparator to be used, per native JS sort() method.
 */
public static native void sort(JsArrayBoolean sortMe, JavaScriptObject comparator) /*-{
  sortMe.sort(comparator);
}-*/;
项目:gwtcc-gwtgl    文件:JsArrayUtil.java   
/**
 * Does the trick for production mode. In production mode, a JavaScript array is used for Java
 * arrays. So we can directly use the array as JsArray. MUST NOT be called in dev mode.
 * 
 * @param array the array to get the JsArray for
 * @return an equivalent JsArray
 */
private static native JsArrayBoolean arrayAsJsArrayForProdMode(boolean[] array) /*-{
return array;
}-*/;