示例#1
0
        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
        }
示例#2
0
        public static int CompareTo(javaByte self, object value)
        {
            if (value == null)
            {
                return(1);
            }

            if (!(value is Byte))
            {
                throw new ArgumentException(Environment.GetResourceString("Arg_MustBeByte"));
            }

            return(((byte)self.byteValue()) - ((byte)value));
        }
示例#3
0
 public bool Equals(javaByte self, byte obj)
 {
     return(self.byteValue() == obj);
 }
示例#4
0
 public int CompareTo(javaByte self, byte value)
 {
     return(((byte)self.byteValue()) - value);
 }
示例#5
0
 public static ByteMap GetAdapter(javaByte self)
 {
     return(new ByteMap((byte)self.byteValue()));
 }