|
| NumericType (SqlTypeCode typeCode, int size, byte scale) |
|
| NumericType (SqlTypeCode typeCode) |
|
| NumericType (SqlTypeCode typeCode, int size) |
|
override bool | Equals (object obj) |
|
override Type | GetObjectType () |
|
override Type | GetRuntimeType () |
|
override bool | IsCacheable (ISqlObject value) |
|
override int | GetHashCode () |
|
override SqlType | Wider (SqlType otherType) |
| Gets the one data-type between this and the other one given that handles the wider range of values. More...
|
|
override bool | IsComparable (SqlType type) |
| Verifies if a given SqlType is comparable to this data-type. More...
|
|
override int | Compare (ISqlObject x, ISqlObject y) |
|
override bool | CanCastTo (SqlType destType) |
| Verifies if this type can cast any value to the given SqlType. More...
|
|
override DataObject | CastTo (DataObject value, SqlType destType) |
| Converts the given object value to a SqlType specified. More...
|
|
override string | ToString () |
|
override object | ConvertTo (ISqlObject obj, Type destType) |
|
override ISqlObject | Add (ISqlObject a, ISqlObject b) |
|
override ISqlObject | Subtract (ISqlObject a, ISqlObject b) |
|
override ISqlObject | Multiply (ISqlObject a, ISqlObject b) |
|
override ISqlObject | Divide (ISqlObject a, ISqlObject b) |
|
override ISqlObject | Modulus (ISqlObject a, ISqlObject b) |
|
override SqlBoolean | IsSmallerThan (ISqlObject a, ISqlObject b) |
|
override SqlBoolean | IsGreatherThan (ISqlObject a, ISqlObject b) |
|
override SqlBoolean | IsSmallerOrEqualThan (ISqlObject a, ISqlObject b) |
|
override SqlBoolean | IsGreaterOrEqualThan (ISqlObject a, ISqlObject b) |
|
override SqlBoolean | IsEqualTo (ISqlObject a, ISqlObject b) |
|
override SqlBoolean | IsNotEqualTo (ISqlObject a, ISqlObject b) |
|
override ISqlObject | Negate (ISqlObject value) |
|
override ISqlObject | Reverse (ISqlObject value) |
|
override ISqlObject | UnaryPlus (ISqlObject value) |
|
override ISqlObject | XOr (ISqlObject a, ISqlObject b) |
|
override ISqlObject | And (ISqlObject a, ISqlObject b) |
|
override ISqlObject | Or (ISqlObject a, ISqlObject b) |
|
override void | SerializeObject (Stream stream, ISqlObject obj) |
|
override ISqlObject | DeserializeObject (Stream stream) |
|
override bool | Equals (object obj) |
|
override int | GetHashCode () |
|
virtual bool | Equals (SqlType other) |
|
override string | ToString () |
|
virtual ISqlObject | CreateFromLargeObject (ILargeObject objRef) |
|
virtual ISqlObject | CreateFrom (object value) |
|
|
static SqlType | Parse (string s) |
| Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent. More...
|
|
static SqlType | Parse (IContext context, string s) |
| Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent. More...
|
|
static bool | IsPrimitiveType (SqlTypeCode typeCode) |
|
static SqlType | Resolve (SqlTypeCode typeCode) |
|
static SqlType | Resolve (SqlTypeCode typeCode, DataTypeMeta[] meta) |
|
static SqlType | Resolve (SqlTypeCode typeCode, DataTypeMeta[] meta, ITypeResolver resolver) |
|
static SqlType | Resolve (SqlTypeCode typeCode, string name) |
|
static SqlType | Resolve (SqlTypeCode typeCode, string name, DataTypeMeta[] meta) |
|
static SqlType | Resolve (string name) |
|
static SqlType | Resolve (string name, DataTypeMeta[] meta) |
|
static SqlType | Resolve (string name, DataTypeMeta[] meta, ITypeResolver resolver) |
|
static SqlType | Resolve (SqlTypeCode typeCode, string name, DataTypeMeta[] meta, ITypeResolver resolver) |
|
Definition at line 27 of file NumericType.cs.
Converts the given object value to a SqlType specified.
- Parameters
-
value | The value to convert. |
destType | The destination type of the conversion. |
If the given destType destination type is equivalent to this type, it will return the value provided, otherwise it will throw an exception by default.
Casting values to specific types is specific to each data-type: override this method to support type-specific conversions.
When overriding this method, CanCastTo should be overridden accordingly to indicate the type supports casting.
- Returns
- Returns an instance of DataObject that is the result of the conversion from this data-type to the other type given.
Reimplemented from Deveel.Data.Types.SqlType.
Definition at line 221 of file NumericType.cs.
223 var sqlType = destType.TypeCode;
259 casted =
new SqlString(n.ToString().PadRight(((StringType) destType).MaxSize));
269 casted =
ToDate(n.ToInt64());
281 throw new InvalidCastException();
284 return new DataObject(destType, casted);
NumericState
Lists all the possible special states of a number.
Implements a BINARY object that handles a limited number of bytes, not exceding MaxLength.
static readonly SqlNull Value
Defines the contract for a valid SQL Object
static SqlDateTime ToDate(long time)
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Deveel.Data.Sql.Objects.SqlBoolean SqlBoolean
Deveel.Data.Sql.Objects.SqlString SqlString
override bool Deveel.Data.Types.NumericType.IsComparable |
( |
SqlType |
type | ) |
|
|
inlinevirtual |
Verifies if a given SqlType is comparable to this data-type.
- Parameters
-
type | The other data-type to verify the compatibility. |
It is not required two SqlType to be identical to be compared: when overridden by a derived class, this methods verifies the properties of the argument type, to see if values handled by the types can be compared.
By default, this method compares the values returned by TypeCode to see if they are identical.
- Returns
- Returns
true
if the values handled by this data-type can be compared to ones handled by the given type , or false
otherwise.
Reimplemented from Deveel.Data.Types.SqlType.
Definition at line 191 of file NumericType.cs.
NumericType(SqlTypeCode typeCode, int size, byte scale)
override SqlType Deveel.Data.Types.NumericType.Wider |
( |
SqlType |
otherType | ) |
|
|
inlinevirtual |
Gets the one data-type between this and the other one given that handles the wider range of values.
- Parameters
-
otherType | The other type to verify. |
This is very important for operations and functions, when operating on objects with comparable but different data-types, to ensure the result of the operation will be capable to handle the final value.
By default, this method returns this instance, as it is not able to dynamically define the wider type.
- Returns
- Returns this type if it handles a wider range of values or otherType other type given otherwise.
Reimplemented from Deveel.Data.Types.SqlType.
Definition at line 138 of file NumericType.cs.
163 if (t1IntSize > 0 && t2IntSize > 0) {
165 return (t1IntSize > t2IntSize) ?
this : otherType;
170 if (t1FloatSize > 0 && t2FloatSize > 0) {
172 return (t1FloatSize > t2FloatSize) ?
this : otherType;
175 if (t1FloatSize > t2IntSize) {
178 if (t2FloatSize > t1IntSize) {
181 if (t1IntSize >= t2FloatSize || t2IntSize >= t1FloatSize) {
188 throw new InvalidOperationException(
"Widest type error.");
NumericType(SqlTypeCode typeCode, int size, byte scale)
SqlTypeCode TypeCode
Gets the kind of SQL type this data-type handles.
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
static int GetIntSize(SqlTypeCode sqlType)
static int GetFloatSize(SqlTypeCode sqlType)