public void Serialize() { object obj = new java.lang.Long(long.MaxValue); byte[] bytes = SqlObject.Serialize(obj); Assert.That(!SqlObject.StartsWithSerializationHeader(bytes)); SqlObject wrapper = new SqlObject(bytes, true); object wrappedObject = wrapper.getObject(); Assert.AreEqual(new java.lang.Long(long.MaxValue), wrappedObject); bytes = SqlObject.Serialize(long.MaxValue); Assert.That(SqlObject.StartsWithSerializationHeader(bytes)); bool isJavaObject; obj = SqlObject.Deserialize(bytes, out isJavaObject); Assert.IsFalse(isJavaObject); Assert.AreEqual(long.MaxValue, obj); wrapper = new SqlObject(bytes); obj = wrapper.getObject(); Assert.AreEqual(long.MaxValue, obj); }
public static int CompareTo(javaLong self, object value) { ulong m_value = unchecked ((ulong)self.longValue()); if (value == null) { return(1); } if (value is UInt64) { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. ulong i = (ulong)value; if (m_value < i) { return(-1); } if (m_value > i) { return(1); } return(0); } throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt64")); }
public static global::System.Object get(global::java.lang.Object n1, int n2){ //XMLVM_BEGIN_WRAPPER[java.lang.reflect.Array: java.lang.Object get(java.lang.Object, int)] throw new org.xmlvm._nNotYetImplementedException("native/wrapper method not yet implemented"); if (n1==null) { java.lang.NullPointerException jex = new java.lang.NullPointerException(); jex.@this(); throw new org.xmlvm._nExceptionAdapter(jex); } else if (n1 is org.xmlvm._nArrayAdapter<object>) { return ((org.xmlvm._nArrayAdapter<object>) n1)[n2]; } else if (n1 is org.xmlvm._nArrayAdapter<bool>) { bool unwrappedBoolean = ((org.xmlvm._nArrayAdapter<bool>) n1)[n2]; java.lang.Boolean result = new java.lang.Boolean(); result.@this(unwrappedBoolean); return result; } else if (n1 is org.xmlvm._nArrayAdapter<sbyte>) { sbyte unwrappedByte = ((org.xmlvm._nArrayAdapter<sbyte>) n1)[n2]; java.lang.Byte result = new java.lang.Byte(); result.@this(unwrappedByte); return result; } else if (n1 is org.xmlvm._nArrayAdapter<char>) { char unwrappedChar = ((org.xmlvm._nArrayAdapter<char>) n1)[n2]; java.lang.Character result = new java.lang.Character(); result.@this(unwrappedChar); return result; } else if (n1 is org.xmlvm._nArrayAdapter<short>) { short unwrappedShort = ((org.xmlvm._nArrayAdapter<short>) n1)[n2]; java.lang.Short result = new java.lang.Short(); result.@this(unwrappedShort); return result; } else if (n1 is org.xmlvm._nArrayAdapter<int>) { int unwrappedInteger = ((org.xmlvm._nArrayAdapter<int>) n1)[n2]; java.lang.Integer result = new java.lang.Integer(); result.@this(unwrappedInteger); return result; } else if (n1 is org.xmlvm._nArrayAdapter<long>) { long unwrappedLong = ((org.xmlvm._nArrayAdapter<long>) n1)[n2]; java.lang.Long result = new java.lang.Long(); result.@this(unwrappedLong); return result; } else if (n1 is org.xmlvm._nArrayAdapter<float>) { float unwrappedFloat = ((org.xmlvm._nArrayAdapter<float>) n1)[n2]; java.lang.Float result = new java.lang.Float(); result.@this(unwrappedFloat); return result; } else if (n1 is org.xmlvm._nArrayAdapter<double>) { double unwrappedDouble = ((org.xmlvm._nArrayAdapter<double>) n1)[n2]; java.lang.Double result = new java.lang.Double(); result.@this(unwrappedDouble); return result; } else if (!(n1 is org.xmlvm._nIArray)) { // it is not an org.xmlvm._nIArray java.lang.IllegalArgumentException jex = new java.lang.IllegalArgumentException(); jex.@this(org.xmlvm._nUtil.toJavaString("Not an array")); throw new org.xmlvm._nExceptionAdapter(jex); } else { // something went wrong throw new org.xmlvm._nNativeImplementationException(); } //XMLVM_END_WRAPPER[java.lang.reflect.Array: java.lang.Object get(java.lang.Object, int)] }
public void Serialize() { object obj = new java.lang.Long(long.MaxValue); byte[] bytes = SqlObject.Serialize(obj); Assert.That(!SqlObject.StartsWithSerializationHeader(bytes)); SqlObject wrapper = new SqlObject(bytes, true); object wrappedObject = wrapper.getObject(); Assert.AreEqual(new java.lang.Long(long.MaxValue), wrappedObject); bytes = SqlObject.Serialize(long.MaxValue); Assert.That(SqlObject.StartsWithSerializationHeader(bytes)); bool isJavaObject; obj = SqlObject.Deserialize(bytes, out isJavaObject); Assert.IsFalse(isJavaObject); Assert.AreEqual(long.MaxValue, obj); wrapper = new SqlObject(bytes); obj = wrapper.getObject(); Assert.AreEqual(long.MaxValue, obj); }
public static bool Equals(javaLong self, object obj) { ulong m_value = unchecked ((ulong)self.longValue()); if (!(obj is UInt64)) { return(false); } return(m_value == ((ulong)obj)); }
public void put(java.lang.String arg0, java.lang.Long arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::android.content.ContentValues._put1256, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.ContentValues.staticClass, global::android.content.ContentValues._put1256, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } }
public int compareTo(java.lang.Long arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { return(@__env.CallIntMethod(this.JvmHandle, global::java.lang.Long._compareTo13035, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))); } else { return(@__env.CallNonVirtualIntMethod(this.JvmHandle, global::java.lang.Long.staticClass, global::java.lang.Long._compareTo13035, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))); } }
internal static object Unbox(object val) { #if STATIC_COMPILER || FIRST_PASS || STUB_GENERATOR return(null); #else java.lang.Byte b = val as java.lang.Byte; if (b != null) { return(b.byteValue()); } java.lang.Boolean b1 = val as java.lang.Boolean; if (b1 != null) { return(b1.booleanValue()); } java.lang.Short s = val as java.lang.Short; if (s != null) { return(s.shortValue()); } java.lang.Character c = val as java.lang.Character; if (c != null) { return(c.charValue()); } java.lang.Integer i = val as java.lang.Integer; if (i != null) { return(i.intValue()); } java.lang.Float f = val as java.lang.Float; if (f != null) { return(f.floatValue()); } java.lang.Long l = val as java.lang.Long; if (l != null) { return(l.longValue()); } java.lang.Double d = val as java.lang.Double; if (d != null) { return(d.doubleValue()); } else { throw new java.lang.IllegalArgumentException(); } #endif }
public static object ConvertToJava(object result) { if (result is int) { result = new java.lang.Integer((int)result); } else if (result is long) { result = new java.lang.Long((long)result); } else if (result is short) { result = new java.lang.Short((short)result); } return(result); }
public static object ConvertToJava(object result) { if (result is int) { result = new java.lang.Integer((int)result); } else if (result is long) { result = new java.lang.Long((long)result); } else if (result is short) { result = new java.lang.Short((short)result); } return result; }
public static int CompareTo(javaLong self, ulong value) { ulong m_value = unchecked ((ulong)self.longValue()); // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. if (m_value < value) { return(-1); } if (m_value > value) { return(1); } return(0); }
public static Int64Map GetAdapter(javaLong self) { return(new Int64Map(self.longValue())); }
/* * public static java.lang.String nativeTypeToJavaTypeName(global::System.Type nativeType) { * string result; * _nTIB tib; * if(!tibTable.TryGetValue(nativeType, out tib)) { * // if it is not already in the table, * // then the native type name is the same as the java counterpart * result = nativeType.ToString(); * tib = new _nTIB(nativeType, result); * tibTable.Add(nativeType, tib); * jNameTable.Add(result, tib); * bootstrapSetClass(tib); * } else { * result = tib.getJavaName(); * } * return org.xmlvm._nUtil.toJavaString(result); * } */ public static java.lang.Object boxIfPrimitive(global::System.Object aValue, global::System.Type aType) { if (!aType.IsPrimitive) { return((java.lang.Object)aValue); // do nothing } else if (aType.Equals(booleanType)) { java.lang.Boolean boolBox = new java.lang.Boolean(); boolBox.@this((bool)aValue); return(boolBox); } else if (aType.Equals(byteType)) { java.lang.Byte byteBox = new java.lang.Byte(); byteBox.@this((sbyte)aValue); return(byteBox); } else if (aType.Equals(charType)) { java.lang.Character charBox = new java.lang.Character(); charBox.@this((char)aValue); return(charBox); } else if (aType.Equals(shortType)) { java.lang.Short shortBox = new java.lang.Short(); shortBox.@this((short)aValue); return(shortBox); } else if (aType.Equals(intType)) { java.lang.Integer intBox = new java.lang.Integer(); intBox.@this((int)aValue); return(intBox); } else if (aType.Equals(longType)) { java.lang.Long longBox = new java.lang.Long(); longBox.@this((long)aValue); return(longBox); } else if (aType.Equals(floatType)) { java.lang.Float floatBox = new java.lang.Float(); floatBox.@this((float)aValue); return(floatBox); } else if (aType.Equals(doubleType)) { java.lang.Double doubleBox = new java.lang.Double(); doubleBox.@this((double)aValue); return(doubleBox); } else if (aType.Equals(voidType)) { java.lang.Void voidBox = new java.lang.Void(); voidBox.@this(); return(voidBox); } else { throw new org.xmlvm._nNativeImplementationException(); } }
public static string ToString(javaLong self, string format) { ulong m_value = unchecked ((ulong)self.longValue()); return(Number.FormatUInt64(m_value, format, NumberFormatInfo.CurrentInfo)); }
public static bool Equals(javaLong self, long obj) { return(self.longValue() == obj); }
public static bool Equals(javaLong self, ulong obj) { ulong m_value = unchecked ((ulong)self.longValue()); return(m_value == obj); }
public static string ToString(javaLong self, IFormatProvider provider) { ulong m_value = unchecked ((ulong)self.longValue()); return(Number.FormatUInt64(m_value, null, NumberFormatInfo.GetInstance(provider))); }
public static string ToString(javaLong self, string format) { return(Number.FormatInt64(self.longValue(), format, NumberFormatInfo.CurrentInfo)); }
public static java.lang.Object boxIfPrimitive(global::System.Object aValue, global::System.Type aType) { if (!aType.GetTypeInfo().IsPrimitive) { return (java.lang.Object) aValue; // do nothing } else if (aType.Equals(booleanType)) { java.lang.Boolean boolBox = new java.lang.Boolean(); boolBox.@this((bool) aValue); return boolBox; } else if (aType.Equals(byteType)) { java.lang.Byte byteBox = new java.lang.Byte(); byteBox.@this((sbyte) aValue); return byteBox; } else if (aType.Equals(charType)) { java.lang.Character charBox = new java.lang.Character(); charBox.@this((char) aValue); return charBox; } else if (aType.Equals(shortType)) { java.lang.Short shortBox = new java.lang.Short(); shortBox.@this((short) aValue); return shortBox; } else if (aType.Equals(intType)) { java.lang.Integer intBox = new java.lang.Integer(); intBox.@this((int) aValue); return intBox; } else if (aType.Equals(longType)) { java.lang.Long longBox = new java.lang.Long(); longBox.@this((long) aValue); return longBox; } else if (aType.Equals(floatType)) { java.lang.Float floatBox = new java.lang.Float(); floatBox.@this((float) aValue); return floatBox; } else if (aType.Equals(doubleType)) { java.lang.Double doubleBox = new java.lang.Double(); doubleBox.@this((double) aValue); return doubleBox; } else if (aType.Equals(voidType)) { java.lang.Void voidBox = new java.lang.Void(); voidBox.@this(); return voidBox; } else { throw new org.xmlvm._nNativeImplementationException(); } }
public static string ToString(javaLong self, string format, IFormatProvider provider) { return(Number.FormatInt64(self.longValue(), format, NumberFormatInfo.GetInstance(provider))); }
public static UInt64Map GetAdapter(javaLong self) { return(new UInt64Map(unchecked ((ulong)self.longValue()))); }
public static TypeCode GetTypeCode(javaLong self) { return(TypeCode.UInt64); }
public static global::java.lang.Long getLong(java.lang.String arg0, java.lang.Long arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; return(global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallStaticObjectMethod(java.lang.Long.staticClass, global::java.lang.Long._getLong13039, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1))) as java.lang.Long); }
public static global::System.Object get(global::java.lang.Object n1, int n2) { //XMLVM_BEGIN_WRAPPER[java.lang.reflect.Array: java.lang.Object get(java.lang.Object, int)] throw new org.xmlvm._nNotYetImplementedException("native/wrapper method not yet implemented"); if (n1 == null) { java.lang.NullPointerException jex = new java.lang.NullPointerException(); jex.@this(); throw new org.xmlvm._nExceptionAdapter(jex); } else if (n1 is org.xmlvm._nArrayAdapter <object> ) { return(((org.xmlvm._nArrayAdapter <object>)n1)[n2]); } else if (n1 is org.xmlvm._nArrayAdapter <bool> ) { bool unwrappedBoolean = ((org.xmlvm._nArrayAdapter <bool>)n1)[n2]; java.lang.Boolean result = new java.lang.Boolean(); result.@this(unwrappedBoolean); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <sbyte> ) { sbyte unwrappedByte = ((org.xmlvm._nArrayAdapter <sbyte>)n1)[n2]; java.lang.Byte result = new java.lang.Byte(); result.@this(unwrappedByte); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <char> ) { char unwrappedChar = ((org.xmlvm._nArrayAdapter <char>)n1)[n2]; java.lang.Character result = new java.lang.Character(); result.@this(unwrappedChar); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <short> ) { short unwrappedShort = ((org.xmlvm._nArrayAdapter <short>)n1)[n2]; java.lang.Short result = new java.lang.Short(); result.@this(unwrappedShort); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <int> ) { int unwrappedInteger = ((org.xmlvm._nArrayAdapter <int>)n1)[n2]; java.lang.Integer result = new java.lang.Integer(); result.@this(unwrappedInteger); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <long> ) { long unwrappedLong = ((org.xmlvm._nArrayAdapter <long>)n1)[n2]; java.lang.Long result = new java.lang.Long(); result.@this(unwrappedLong); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <float> ) { float unwrappedFloat = ((org.xmlvm._nArrayAdapter <float>)n1)[n2]; java.lang.Float result = new java.lang.Float(); result.@this(unwrappedFloat); return(result); } else if (n1 is org.xmlvm._nArrayAdapter <double> ) { double unwrappedDouble = ((org.xmlvm._nArrayAdapter <double>)n1)[n2]; java.lang.Double result = new java.lang.Double(); result.@this(unwrappedDouble); return(result); } else if (!(n1 is org.xmlvm._nIArray)) { // it is not an org.xmlvm._nIArray java.lang.IllegalArgumentException jex = new java.lang.IllegalArgumentException(); jex.@this(org.xmlvm._nUtil.toJavaString("Not an array")); throw new org.xmlvm._nExceptionAdapter(jex); } else { // something went wrong throw new org.xmlvm._nNativeImplementationException(); } //XMLVM_END_WRAPPER[java.lang.reflect.Array: java.lang.Object get(java.lang.Object, int)] }