MfType

Namespace ›› System ››
Parent Previous Next

MfType Class

(Inherits from MfObject)

Represents type declarations: class types, array types, enumeration types, type parameters, generic type definitions of Mini-Framework.

Links

Properties, Methods, Example

Constructors


Name

Description

Constructor(obj)

Creates a MfType instance with type information for obj.

Constructor(obj, TypeName)

Creates a MfType instance with type information for obj  and assigns TypeName to TypeName Property.

Properties


Name

Description

ClassName

Gets the Class name as a string var for the current type.

IsBoolean

Gets if the type is MfBool.

IsBigInt

Gets if the type is MfBigInt.

IsByte

Gets if the type is MfByte.

IsChar

Gets if the type is MfChar.

IsEmpty

IsEmpty Gets if the current MfType is Empty or null

IsEnum

IsEnum Gets if the type is MfEnum.

IsEnumItem

IsEnumItem Gets if the type is MfEnum.EnumItem.

IsFloat

Gets if the type is MfFloat

IsInteger

Gets if the type is MfInteger.

IsInt16

Gets if the type is MfInt16.

IsInt32

Gets if the type is MfInteger.

IsInt64

Gets if the type is MfInt64.

IsIntegerNumber

Gets if the current Type is integer

IsMfObject

Gets if the type is MfObject.

IsNumber

Gets if the current Type is numeric

IsSByte

Gets if the type is MfSByte.

IsString

Gets if the type is MfString.

IsUInt16

Gets if the type is MfUInt16.

IsUInt32

Gets if the type is MfUInt32.

IsUInt64

Gets if the type is MfUInt64.

TypeCode

Gets the TypeCode as a string var for the current type.

TypeName

Gets the TypeName as a string var for the current type.

Methods


Name

Description

CompareTo(obj)

Compares the current instance of MfType with another instance of MfType and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. Overrides MfObject.CompareTo()

Equals(objA)

Compares MfType instance to current instance to see if they are the same.

Equals(objA, objB)

Compares MfType objA and objB to see if they are the same.

Is(type)

Gets if current instance of object is of the same type. Inherited from MfObject. Inherited from MfObject.

InheritancePath(obj)

Formats a string var that contains the Inheritance Path for an object represented by obj.

IsInstance()

Get if the current class is an instance. Inherited from MfObject.

IsObject()

Gets if the type for the MfType Instance is an Object or MfObject.

MemberwiseClone()

Creates a shallow copy of the current MfObject instance. Inherited from MfObject.

ToString()

Gets a string containing the TypeName of the current type. Overrides MfObject.ToString().

TypeOf(obj)

Returns the type of the given Object

TypeOfName(obj)

Gets a string var of class or type name.

Example

GetIntNumber(obj) {
   if (MfNull.IsNull(value)) {
       ex := new MfArgumentNullException("obj")
       ex.SetProp(A_LineFile, A_LineNumber, A_ThisFunc)
       throw ex
   }
   T := new MfType(obj)
   if (T.IsIntegerNumber)
   {
       return obj.Value
   }
   else
   {
       msg := MfEnvironment.Instance.GetResourceString("InvalidCastException_ValueToInteger")
       ex := new MfArgumentException(msg, "obj")
       ex.SetProp(A_LineFile, A_LineNumber, A_ThisFunc)
       throw ex
   }
}