Wiki
Version 7 (modified by hopscc, 16 years ago)

Add heading

Primitive Type Members

You can invoke methods on primitive values (that the libraries provide as static methods on the Type) such as c.isUpper. These include mathematical methods such as x.round, x.round(decimals), a.min(b), x.sin, x.truncate, etc.

You can also invoke methods on primitive types such as decimal.parse(s).

Some additional examples can be found in the test code.

See also: TypesOverview

Below is a complete listing of the methods available.

type bool
    shared
        def parse(value as String) as bool
        def tryParse(value as String, result as out bool) as bool
    def compareTo(obj as Object) as int
    def compareTo(value as bool) as int
    def equals(obj as bool) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def toString(provider as IFormatProvider) as String
    def toString as String

type char
    shared
        def convertFromUtf32(utf32 as int) as String
        def convertToUtf32(s as String, index as int) as int
        def getNumericValue(s as String, index as int) as float
        def getUnicodeCategory(s as String, index as int) as UnicodeCategory
        def isControl(s as String, index as int) as bool
        def isDigit(s as String, index as int) as bool
        def isHighSurrogate(s as String, index as int) as bool
        def isLetter(s as String, index as int) as bool
        def isLetterOrDigit(s as String, index as int) as bool
        def isLower(s as String, index as int) as bool
        def isLowSurrogate(s as String, index as int) as bool
        def isNumber(s as String, index as int) as bool
        def isPunctuation(s as String, index as int) as bool
        def isSeparator(s as String, index as int) as bool
        def isSurrogate(s as String, index as int) as bool
        def isSurrogatePair(s as String, index as int) as bool
        def isSymbol(s as String, index as int) as bool
        def isUpper(s as String, index as int) as bool
        def isWhiteSpace(s as String, index as int) as bool
        def parse(s as String) as char
        def tryParse(s as String, result as out char) as bool
    def compareTo(value as Object) as int
    def compareTo(value as char) as int
    def convertToUtf32(lowSurrogate as char) as int
    def equals(obj as Object) as bool
    def equals(obj as char) as bool
    def getHashCode as int
    def getNumericValue as float
    def getTypeCode as TypeCode
    def getUnicodeCategory as UnicodeCategory
    def isControl as bool
    def isDigit as bool
    def isHighSurrogate as bool
    def isLetter as bool
    def isLetterOrDigit as bool
    def isLower as bool
    def isLowSurrogate as bool
    def isNumber as bool
    def isPunctuation as bool
    def isSeparator as bool
    def isSurrogate as bool
    def isSurrogatePair(lowSurrogate as char) as bool
    def isSymbol as bool
    def isUpper as bool
    def isWhiteSpace as bool
    def toLower(culture as CultureInfo) as char
    def toLower as char
    def toLowerInvariant as char
    def toString as String
    def toString as String
    def toString(provider as IFormatProvider) as String
    def toUpper as char
    def toUpper(culture as CultureInfo) as char
    def toUpperInvariant as char

type decimal
    shared
        def fromOACurrency(cy as int64) as decimal
        def parse(s as String, provider as IFormatProvider) as decimal
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as decimal
        def parse(s as String) as decimal
        def parse(s as String, style as NumberStyles) as decimal
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out decimal) as bool
        def tryParse(s as String, result as out decimal) as bool
    def abs as decimal
    def add(d2 as decimal) as decimal
    def ceiling as decimal
    def ceiling as decimal
    def compare(d2 as decimal) as int
    def compareTo(value as decimal) as int
    def compareTo(value as Object) as int
    def divide(d2 as decimal) as decimal
    def equals(d2 as decimal) as bool
    def equals(value as Object) as bool
    def equals(value as decimal) as bool
    def floor as decimal
    def floor as decimal
    def getBits as int[]
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as decimal) as decimal
    def min(val2 as decimal) as decimal
    def multiply(d2 as decimal) as decimal
    def negate as decimal
    def pow(y as decimal) as decimal
    def remainder(d2 as decimal) as decimal
    def round(decimals as int) as decimal
    def round as decimal
    def round(decimals as int, mode as MidpointRounding) as decimal
    def round as decimal
    def round(decimals as int, mode as MidpointRounding) as decimal
    def round(decimals as int) as decimal
    def round(mode as MidpointRounding) as decimal
    def round(mode as MidpointRounding) as decimal
    def sign as int
    def sqrt as decimal
    def subtract(d2 as decimal) as decimal
    def toByte as uint8
    def toDouble as float
    def toInt16 as int16
    def toInt32 as int
    def toInt64 as int64
    def toOACurrency as int64
    def toSByte as int8
    def toSingle as float32
    def toString(provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString as String
    def toString(format as String, provider as IFormatProvider) as String
    def toUInt16 as uint16
    def toUInt32 as uint
    def toUInt64 as uint64
    def truncate as decimal
    def truncate as decimal

type float
    shared
        def parse(s as String, provider as IFormatProvider) as float
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as float
        def parse(s as String) as float
        def parse(s as String, style as NumberStyles) as float
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out float) as bool
        def tryParse(s as String, result as out float) as bool
    def abs as float
    def acos as float
    def asin as float
    def atan as float
    def atan2(x as float) as float
    def ceiling as float
    def compareTo(value as Object) as int
    def compareTo(value as float) as int
    def cos as float
    def cosh as float
    def equals(obj as float) as bool
    def equals(obj as Object) as bool
    def exp as float
    def floor as float
    def getHashCode as int
    def getTypeCode as TypeCode
    def ieeeRemainder(y as float) as float
    def isInfinity as bool
    def isNaN as bool
    def isNegativeInfinity as bool
    def isPositiveInfinity as bool
    def log as float
    def log(newBase as float) as float
    def log10 as float
    def max(val2 as float) as float
    def min(val2 as float) as float
    def pow(y as float) as float
    def round(digits as int, mode as MidpointRounding) as float
    def round(mode as MidpointRounding) as float
    def round as float
    def round(digits as int) as float
    def sign as int
    def sin as float
    def sinh as float
    def sqrt as float
    def tan as float
    def tanh as float
    def toString(provider as IFormatProvider) as String
    def toString(format as String, provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString as String
    def truncate as float

type float32
    shared
        def parse(s as String, provider as IFormatProvider) as float32
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as float32
        def parse(s as String) as float32
        def parse(s as String, style as NumberStyles) as float32
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out float32) as bool
        def tryParse(s as String, result as out float32) as bool
    def abs as float32
    def compareTo(value as float32) as int
    def compareTo(value as Object) as int
    def equals(obj as float32) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def isInfinity as bool
    def isNaN as bool
    def isNegativeInfinity as bool
    def isPositiveInfinity as bool
    def max(val2 as float32) as float32
    def min(val2 as float32) as float32
    def sign as int
    def toString(provider as IFormatProvider) as String
    def toString as String
    def toString(format as String, provider as IFormatProvider) as String
    def toString(format as String) as String

type int8
    shared
        def parse(s as String, provider as IFormatProvider) as int8
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as int8
        def parse(s as String) as int8
        def parse(s as String, style as NumberStyles) as int8
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out int8) as bool
        def tryParse(s as String, result as out int8) as bool
    def abs as int8
    def compareTo(obj as Object) as int
    def compareTo(value as int8) as int
    def equals(obj as Object) as bool
    def equals(obj as int8) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as int8) as int8
    def min(val2 as int8) as int8
    def sign as int
    def toString(provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString(format as String, provider as IFormatProvider) as String
    def toString as String

type int16
    shared
        def parse(s as String, provider as IFormatProvider) as int16
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as int16
        def parse(s as String) as int16
        def parse(s as String, style as NumberStyles) as int16
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out int16) as bool
        def tryParse(s as String, result as out int16) as bool
    def abs as int16
    def compareTo(value as int16) as int
    def compareTo(value as Object) as int
    def equals(obj as Object) as bool
    def equals(obj as int16) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as int16) as int16
    def min(val2 as int16) as int16
    def sign as int
    def toString(format as String) as String
    def toString(provider as IFormatProvider) as String
    def toString as String
    def toString(format as String, provider as IFormatProvider) as String

type int
    shared
        def parse(s as String, provider as IFormatProvider) as int
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as int
        def parse(s as String) as int
        def parse(s as String, style as NumberStyles) as int
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out int) as bool
        def tryParse(s as String, result as out int) as bool
    def abs as int
    def bigMul(b as int) as int64
    def compareTo(value as Object) as int
    def compareTo(value as int) as int
    def divRem(b as int, result as out int) as int
    def equals(obj as Object) as bool
    def equals(obj as int) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as int) as int
    def min(val2 as int) as int
    def sign as int
    def toString(provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString(format as String, provider as IFormatProvider) as String
    def toString as String

type int64
    shared
        def parse(s as String, provider as IFormatProvider) as int64
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as int64
        def parse(s as String) as int64
        def parse(s as String, style as NumberStyles) as int64
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out int64) as bool
        def tryParse(s as String, result as out int64) as bool
    def abs as int64
    def compareTo(value as int64) as int
    def compareTo(value as Object) as int
    def divRem(b as int64, result as out int64) as int64
    def equals(obj as int64) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as int64) as int64
    def min(val2 as int64) as int64
    def sign as int
    def toString(format as String) as String
    def toString(provider as IFormatProvider) as String
    def toString as String
    def toString(format as String, provider as IFormatProvider) as String

type uint8
    shared
        def parse(s as String, provider as IFormatProvider) as uint8
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as uint8
        def parse(s as String) as uint8
        def parse(s as String, style as NumberStyles) as uint8
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out uint8) as bool
        def tryParse(s as String, result as out uint8) as bool
    def compareTo(value as uint8) as int
    def compareTo(value as Object) as int
    def equals(obj as uint8) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as uint8) as uint8
    def min(val2 as uint8) as uint8
    def toString as String
    def toString(format as String, provider as IFormatProvider) as String
    def toString(provider as IFormatProvider) as String
    def toString(format as String) as String

type uint16
    shared
        def parse(s as String, provider as IFormatProvider) as uint16
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as uint16
        def parse(s as String) as uint16
        def parse(s as String, style as NumberStyles) as uint16
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out uint16) as bool
        def tryParse(s as String, result as out uint16) as bool
    def compareTo(value as uint16) as int
    def compareTo(value as Object) as int
    def equals(obj as uint16) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as uint16) as uint16
    def min(val2 as uint16) as uint16
    def toString as String
    def toString(format as String, provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString(provider as IFormatProvider) as String

type uint
    shared
        def parse(s as String, provider as IFormatProvider) as uint
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as uint
        def parse(s as String) as uint
        def parse(s as String, style as NumberStyles) as uint
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out uint) as bool
        def tryParse(s as String, result as out uint) as bool
    def compareTo(value as uint) as int
    def compareTo(value as Object) as int
    def equals(obj as uint) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as uint) as uint
    def min(val2 as uint) as uint
    def toString as String
    def toString(provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString(format as String, provider as IFormatProvider) as String

type uint64
    shared
        def parse(s as String, provider as IFormatProvider) as uint64
        def parse(s as String, style as NumberStyles, provider as IFormatProvider) as uint64
        def parse(s as String) as uint64
        def parse(s as String, style as NumberStyles) as uint64
        def tryParse(s as String, style as NumberStyles, provider as IFormatProvider, result as out uint64) as bool
        def tryParse(s as String, result as out uint64) as bool
    def compareTo(value as uint64) as int
    def compareTo(value as Object) as int
    def equals(obj as uint64) as bool
    def equals(obj as Object) as bool
    def getHashCode as int
    def getTypeCode as TypeCode
    def max(val2 as uint64) as uint64
    def min(val2 as uint64) as uint64
    def toString as String
    def toString(provider as IFormatProvider) as String
    def toString(format as String) as String
    def toString(format as String, provider as IFormatProvider) as String

Note: The above documentation can be generated by enabling some code in PrimitiveType._bindInt in Types.cobra.