public int getJdbcType() // throws IllegalStateException
        {
            string name = this.ToString();

            try
            {
                // We assume that the JdbcTypes class only consists of constant
                // integer types, so we make no assertions here
                FieldInfo[] fields = typeof(JdbcTypes).GetFields();
                for (int i = 0; i < fields.Length; i++)
                {
                    FieldInfo field     = fields[i];
                    string    fieldName = field.Name;
                    if (fieldName.Equals(name))
                    {
                        CsInteger value = CsInteger.ZERO;
                        field.GetValue(value);
                        return(value);
                    }
                }
                throw new InvalidOperationException("No JdbcType found with field name: " + name);
            }
            catch (Exception e)
            {
                throw new InvalidOperationException("Could not access fields in JdbcTypes", e);
            }
        } // getJdbcType()
예제 #2
0
        } // getComparable()

        public int Compare(object o1, object o2)
        {
            CsNumber n1 = toNumber(o1);
            CsNumber n2 = toNumber(o2);

            if (n1 == null && n2 == null)
            {
                return(0);
            }
            if (n1 == null)
            {
                return(-1);
            }
            if (n2 == null)
            {
                return(1);
            }

            if (n1 is CsNumber && n2 is CsNumber)
            {
                return((n1.asBigInteger()).CompareTo(n2.asBigInteger()));
            }

            //if (n1 is BigDecimal && n2 is BigDecimal) {
            //    return ((BigDecimal)n1).compareTo((BigDecimal)n2);
            //}

            if (NumberComparator.IsIntegerType(n1) && NumberComparator.IsIntegerType(n2))
            {
                return(CsInteger.ValueOf(n1).CompareTo(n2.asLong()));
            }

            return(CsNumber.ValueOf(n1).CompareTo(n2.asLong()));
        } // Compare()
예제 #3
0
 public override string ToString()
 {
     // overridden version of toString() method that uses identity hash code
     // (to prevent hashCode() recursion due to logging!)
     return(GetType().Name + "@"
            + CsInteger.ToHexString(CsSystem.IdentityHashCode(this))); // Integer.toHexString(System.identityHashCode(this));
 } // ToString()
예제 #4
0
        } // constructor

        public StyleImpl(bool bold, bool italic, bool underline, CsInteger fontSize, SizeUnit fontSizeUnit,
                         TextAlignment alignment, Color backgroundColor, Color foregroundColor)
        {
            _bold            = bold;
            _italic          = italic;
            _underline       = underline;
            _fontSize        = fontSize;
            _fontSizeUnit    = fontSizeUnit;
            _alignment       = alignment;
            _backgroundColor = backgroundColor;
            _foregroundColor = foregroundColor;
        } // constructor
예제 #5
0
        }     // ValueOf()

        public static string ToHexString(CsInteger value_arg)
        {
            return(CsInteger.ToHexString(value_arg));
        }     // ToHexString()
예제 #6
0
        }         // constructor

        public static int ValueOf(CsInteger value_arg)
        {
            return(value_arg.asInt());
        }     // ValueOf()