@UnsafeNativeLong public static native String boxArray(JavaScriptObject o, String joiner) /*-{ if (!o) { return ""; } if (!joiner) { joiner = " "; // If using default joiner, let's eat all double spaces in any input strings. // Though the string will lose the ability to have double spacing, it won't have strange breakage. // If you need to support double spaces, be sure to supply your own joiner string, // if using generated code, a @JsProperty String joiner(); method should suffice. for (var i = o.length; i-->0;) { if (o[i]&&o[i].replace) { o[i] = o[i].replace(/([ ][ ]+)/ , " "); } } } if (o.join) { return o.join(joiner); } return o.toString(); }-*/;
protected void writeUnsafeNativeLongIfNeeded(final SourceWriter sw, final JType jtype) { if (JPrimitiveType.LONG.equals(jtype)) { // @com.google.gwt.core.client.UnsafeNativeLong sw.print("@"); sw.println(UnsafeNativeLong.class.getCanonicalName()); } }
@UnsafeNativeLong public static native long getLong(Object object, String key) /*-{ var i = object[key]||null; if (i) { if (typeof i === 'object' && typeof i.l === 'number') { return i; } return @xapi.components.impl.JsSupport::unboxLong(Lcom/google/gwt/core/client/JavaScriptObject;)(i); } return {l:0, m:0, h:0}; }-*/;
@UnsafeNativeLong protected static native JavaScriptObject attributeGetLong(String key) /*-{ return function() { return @xapi.components.impl.JsSupport::unboxLong(Lcom/google/gwt/core/client/JavaScriptObject;)(this.getAttribute(key)); } }-*/;
@UnsafeNativeLong protected static native JavaScriptObject getterLong(String key) /*-{ return function() { return @xapi.components.impl.JsSupport::unboxLong(Lcom/google/gwt/core/client/JavaScriptObject;)(this[key]); } }-*/;
@UnsafeNativeLong protected static native JavaScriptObject setterLong(String key) /*-{ return function(i) { this[key] = i == null ? null : @xapi.components.impl.JsSupport::unboxLong(Lcom/google/gwt/core/client/JavaScriptObject;)(i); return this; } }-*/;
@UnsafeNativeLong protected static native JavaScriptObject getterFloat(String key) /*-{ return function() { return @xapi.components.impl.JsSupport::unboxFloat(Lcom/google/gwt/core/client/JavaScriptObject;)(this[key]); } }-*/;
@UnsafeNativeLong //J2CL_ONLY @JsMethod(name="castToAny") public static native long asLong(Object obj) /*-{ return obj; }-*/;
/** * Production Mode implementation; the int array is already the right object. */ @UnsafeNativeLong protected static native long asLong(LongEmul value) /*-{ return value; }-*/;
@UnsafeNativeLong protected static native long getLong(JavaScriptObject object, String member) /*-{ return object[member]; }-*/;
@UnsafeNativeLong public static native void setLong(Object object, String key, long value) /*-{ object[key]=value; }-*/;
@UnsafeNativeLong protected static native JavaScriptObject attributeSetLong(String key) /*-{ return @xapi.components.impl.JsFunctionAccessors::attributeSetter(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;) (key, @xapi.components.impl.JsSupport::unboxLong(Lcom/google/gwt/core/client/JavaScriptObject;)); }-*/;
@UnsafeNativeLong private static final native JavascriptFunctionInterpolator interpolateNumber0( double a, double b) /*-{ return $wnd.d3.interpolateNumber(a, b); }-*/;
@UnsafeNativeLong private static final native JavascriptFunctionInterpolator interpolateRound0( double a, double b) /*-{ return $wnd.d3.interpolateRound(a, b); }-*/;
@UnsafeNativeLong private static final native JavascriptFunctionInterpolator interpolateZoom0( Array<Double> a, Array<Double> b) /*-{ return $wnd.d3.interpolateZoom(a, b); }-*/;
@UnsafeNativeLong private static final native JavascriptFunctionInterpolator interpolateRgb0( Color a, Color b) /*-{ return $wnd.d3.interpolateRgb(a, b); }-*/;
/** * Actual JSNI implementation; the result is auto-casted to a * {@link JavascriptFunctionInterpolator} and can be used by more specific * versions of the * * @param a * @param b * @return */ @UnsafeNativeLong private static final native <T> JavascriptFunctionInterpolator interpolate0( T a, T b) /*-{ var result = $wnd.d3.interpolate(a, b); return result; }-*/;