@JTranscSync public MemberInfo(int id, String internalName, String name, int modifiers, String desc, String genericDesc) { this.internalName = (internalName != null) ? internalName : name; this.id = id; this.name = name; this.modifiers = modifiers; this.desc = desc; this.genericDesc = genericDesc; }
@JTranscSync public ClassInfo(int id, String internalName, String name, int modifiers, int parent, int[] interfaces, int[] related) { if (internalName == null) internalName = name; this.id = id; this.internalName = internalName; this.name = name; this.modifiers = modifiers; this.parent = parent; this.interfaces = (interfaces != null) ? interfaces : EMPTY_INT_ARRAY; this.related = (related != null) ? related : EMPTY_INT_ARRAY; }
@JTranscSync public JTranscCharset(String[] names, int min, float avg, int max) { this.names = names; this.min = min; this.avg= avg; this.max = max; }
@JTranscSync static public void mixUnsigned(int count, byte[] target, int targetpos, byte[] a, int apos, byte[] b, int bpos, double ratio) { double ratiob = 1.0 - ratio; for (int n = 0; n < count; n++) target[targetpos + n] = (byte) ((a[apos + n] & 0xFF) * ratio + (b[bpos + n] & 0xFF) * ratiob); }
@JTranscSync static public ClassInfo[] getAllClassesMax() { return new ClassInfo[0]; } }
@JTranscSync static public MemberInfo[] getConstructors(int classId) { return new MemberInfo[0]; } }
@JTranscSync static public MemberInfo[] getFields(int classId) { return new MemberInfo[0]; } }
@JTranscSync public JTranscCharBuffer() { size = DEFAULT_SIZE; buffer = new char[size]; }
@JTranscSync public JTranscCharBuffer(int size) { this.size = size < DEFAULT_SIZE ? DEFAULT_SIZE : size; buffer = new char[this.size]; }
@JTranscSync public static void writeCharBE(byte[] out, int offset, char value) { out[offset + 0] = (byte) ((value >>> 8) & 0xFF); out[offset + 1] = (byte) ((value >>> 0) & 0xFF); }
@JTranscSync public static void writeShortBE(byte[] out, int offset, short value) { out[offset + 0] = (byte) ((value >>> 8) & 0xFF); out[offset + 1] = (byte) ((value >>> 0) & 0xFF); }
@JTranscSync public static void writeIntBE(byte[] out, int offset, int value) { out[offset + 0] = (byte) ((value >>> 24) & 0xFF); out[offset + 1] = (byte) ((value >>> 16) & 0xFF); out[offset + 2] = (byte) ((value >>> 8) & 0xFF); out[offset + 3] = (byte) ((value >>> 0) & 0xFF); }
@JTranscSync public static void writeIntLE(byte[] out, int offset, int value) { out[offset + 3] = (byte) ((value >>> 24) & 0xFF); out[offset + 2] = (byte) ((value >>> 16) & 0xFF); out[offset + 1] = (byte) ((value >>> 8) & 0xFF); out[offset + 0] = (byte) ((value >>> 0) & 0xFF); }
@JTranscSync public static String toString(float v) { //return RealToString.getInstance().floatToString(v); String out = toString((double) v); int index = out.indexOf('.'); if (index >= 0) { return out.substring(0, Math.min(out.length(), index + 6)); } else { return out; } //return _toString(v); }
@JTranscInline @JTranscSync public static byte int3(int x) { return (byte) (x >> 24); }
@JTranscInline @JTranscSync public static byte int0(int x) { return (byte) (x >> 0); }
@HaxeMethodBody("return N.box(Reflect.getProperty(this._wrapped, p0._str));") @JTranscMethodBody(target = "js", value = "return N.box({{ JC_COMMA }}this._wrapped[N.istr(p0)]);") @JTranscSync public Object get(String field) { try { Field f = item.getClass().getField(field); f.setAccessible(true); return f.get(this.item); } catch (Throwable e) { return null; } }
@HaxeMethodBody("this._length = p0.length; this._data = p0.getBytes();") @JTranscMethodBody(target = "js", value = "this._length = p0.length; this.buffer = p0.data.buffer;") @JTranscSync private void _initWithBytes(byte[] data) { this.length = data.length; this.data = ByteBuffer.wrap(data).order(ByteOrder.nativeOrder()); }
@HaxeMethodBody("return N.haxeStringArrayToJavaArray(N.haxeIteratorToArray(_map.keys()));") @JTranscMethodBodyList({ @JTranscMethodBody(target = "js", value = "return JA_L.fromArray1(Array.from(this.data.keys()).map(function(it) { return N.str(it); }), 'Ljava/lang/String;');"), @JTranscMethodBody(target = "php", value = "return N::strArray(array_keys($this->data));"), }) @JTranscSync public String[] getKeys() { String[] out = new String[map.size()]; int n = 0; for (String key : this.map.keySet()) out[n++] = key; return out; }
@JTranscSync public static void writeDouble(byte[] out, int offset, double value, boolean isLittleEndian) { if (isLittleEndian) { writeLongLE(out, offset, Double.doubleToRawLongBits(value)); } else { writeLongBE(out, offset, Double.doubleToRawLongBits(value)); } }