Wiki

Changes between Version 1 and Version 2 of PrimitiveTypeMembers

Show
Ignore:
Timestamp:
10/14/08 02:17:55 (16 years ago)
Author:
Chuck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PrimitiveTypeMembers

    v1 v2  
    1 Coming real soon. 
     1You can invoke methods on primitive values such as `c.isUpper`. These include mathematical methods such as `x.round`, `x.round(decimals)`, `a.min(b)`, `x.sin`, `x.truncate`, etc.  
     2 
     3You can also invoke methods on primitive types such as `decimal.parse(s)`. 
     4 
     5Below is a complete listing of the methods available. 
     6 
     7{{{ 
     8#!python 
     9type bool 
     10    shared 
     11        def parse as bool 
     12        def tryParse(result as out bool) as bool 
     13    def compareTo(obj as Object) as int 
     14    def compareTo(value as bool) as int 
     15    def equals(obj as bool) as bool 
     16    def equals(obj as Object) as bool 
     17    def getHashCode as int 
     18    def getTypeCode as TypeCode 
     19    def toString(provider as IFormatProvider) as String 
     20    def toString as String 
     21 
     22type char 
     23    shared 
     24        def convertFromUtf32 as String 
     25        def convertToUtf32(index as int) as int 
     26        def getNumericValue(index as int) as float 
     27        def getUnicodeCategory(index as int) as UnicodeCategory 
     28        def isControl(index as int) as bool 
     29        def isDigit(index as int) as bool 
     30        def isHighSurrogate(index as int) as bool 
     31        def isLetter(index as int) as bool 
     32        def isLetterOrDigit(index as int) as bool 
     33        def isLower(index as int) as bool 
     34        def isLowSurrogate(index as int) as bool 
     35        def isNumber(index as int) as bool 
     36        def isPunctuation(index as int) as bool 
     37        def isSeparator(index as int) as bool 
     38        def isSurrogate(index as int) as bool 
     39        def isSurrogatePair(index as int) as bool 
     40        def isSymbol(index as int) as bool 
     41        def isUpper(index as int) as bool 
     42        def isWhiteSpace(index as int) as bool 
     43        def parse as char 
     44        def tryParse(result as out char) as bool 
     45    def compareTo(value as Object) as int 
     46    def compareTo(value as char) as int 
     47    def convertToUtf32(lowSurrogate as char) as int 
     48    def equals(obj as Object) as bool 
     49    def equals(obj as char) as bool 
     50    def getHashCode as int 
     51    def getNumericValue as float 
     52    def getTypeCode as TypeCode 
     53    def getUnicodeCategory as UnicodeCategory 
     54    def isControl as bool 
     55    def isDigit as bool 
     56    def isHighSurrogate as bool 
     57    def isLetter as bool 
     58    def isLetterOrDigit as bool 
     59    def isLower as bool 
     60    def isLowSurrogate as bool 
     61    def isNumber as bool 
     62    def isPunctuation as bool 
     63    def isSeparator as bool 
     64    def isSurrogate as bool 
     65    def isSurrogatePair(lowSurrogate as char) as bool 
     66    def isSymbol as bool 
     67    def isUpper as bool 
     68    def isWhiteSpace as bool 
     69    def toLower(culture as CultureInfo) as char 
     70    def toLower as char 
     71    def toLowerInvariant as char 
     72    def toString as String 
     73    def toString as String 
     74    def toString(provider as IFormatProvider) as String 
     75    def toUpper as char 
     76    def toUpper(culture as CultureInfo) as char 
     77    def toUpperInvariant as char 
     78 
     79type decimal 
     80    shared 
     81        def fromOACurrency as decimal 
     82        def parse(provider as IFormatProvider) as decimal 
     83        def parse(style as NumberStyles, provider as IFormatProvider) as decimal 
     84        def parse as decimal 
     85        def parse(style as NumberStyles) as decimal 
     86        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out decimal) as bool 
     87        def tryParse(result as out decimal) as bool 
     88    def abs as decimal 
     89    def add(d2 as decimal) as decimal 
     90    def ceiling as decimal 
     91    def ceiling as decimal 
     92    def compare(d2 as decimal) as int 
     93    def compareTo(value as decimal) as int 
     94    def compareTo(value as Object) as int 
     95    def divide(d2 as decimal) as decimal 
     96    def equals(d2 as decimal) as bool 
     97    def equals(value as Object) as bool 
     98    def equals(value as decimal) as bool 
     99    def floor as decimal 
     100    def floor as decimal 
     101    def getBits as int[] 
     102    def getHashCode as int 
     103    def getTypeCode as TypeCode 
     104    def max(val2 as decimal) as decimal 
     105    def min(val2 as decimal) as decimal 
     106    def multiply(d2 as decimal) as decimal 
     107    def negate as decimal 
     108    def remainder(d2 as decimal) as decimal 
     109    def round(decimals as int) as decimal 
     110    def round as decimal 
     111    def round(decimals as int, mode as MidpointRounding) as decimal 
     112    def round as decimal 
     113    def round(decimals as int, mode as MidpointRounding) as decimal 
     114    def round(decimals as int) as decimal 
     115    def round(mode as MidpointRounding) as decimal 
     116    def round(mode as MidpointRounding) as decimal 
     117    def sign as int 
     118    def subtract(d2 as decimal) as decimal 
     119    def toByte as uint8 
     120    def toDouble as float 
     121    def toInt16 as int16 
     122    def toInt32 as int 
     123    def toInt64 as int64 
     124    def toOACurrency as int64 
     125    def toSByte as int8 
     126    def toSingle as float32 
     127    def toString(provider as IFormatProvider) as String 
     128    def toString(format as String) as String 
     129    def toString as String 
     130    def toString(format as String, provider as IFormatProvider) as String 
     131    def toUInt16 as uint16 
     132    def toUInt32 as uint 
     133    def toUInt64 as uint64 
     134    def truncate as decimal 
     135    def truncate as decimal 
     136 
     137type float 
     138    shared 
     139        def parse(provider as IFormatProvider) as float 
     140        def parse(style as NumberStyles, provider as IFormatProvider) as float 
     141        def parse as float 
     142        def parse(style as NumberStyles) as float 
     143        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out float) as bool 
     144        def tryParse(result as out float) as bool 
     145    def abs as float 
     146    def acos as float 
     147    def asin as float 
     148    def atan as float 
     149    def atan2(x as float) as float 
     150    def ceiling as float 
     151    def compareTo(value as Object) as int 
     152    def compareTo(value as float) as int 
     153    def cos as float 
     154    def cosh as float 
     155    def equals(obj as float) as bool 
     156    def equals(obj as Object) as bool 
     157    def exp as float 
     158    def floor as float 
     159    def getHashCode as int 
     160    def getTypeCode as TypeCode 
     161    def ieeeRemainder(y as float) as float 
     162    def isInfinity as bool 
     163    def isNaN as bool 
     164    def isNegativeInfinity as bool 
     165    def isPositiveInfinity as bool 
     166    def log as float 
     167    def log(newBase as float) as float 
     168    def log10 as float 
     169    def max(val2 as float) as float 
     170    def min(val2 as float) as float 
     171    def pow(y as float) as float 
     172    def round(digits as int, mode as MidpointRounding) as float 
     173    def round(mode as MidpointRounding) as float 
     174    def round as float 
     175    def round(digits as int) as float 
     176    def sign as int 
     177    def sin as float 
     178    def sinh as float 
     179    def sqrt as float 
     180    def tan as float 
     181    def tanh as float 
     182    def toString(provider as IFormatProvider) as String 
     183    def toString(format as String, provider as IFormatProvider) as String 
     184    def toString(format as String) as String 
     185    def toString as String 
     186    def truncate as float 
     187 
     188type float32 
     189    shared 
     190        def parse(provider as IFormatProvider) as float32 
     191        def parse(style as NumberStyles, provider as IFormatProvider) as float32 
     192        def parse as float32 
     193        def parse(style as NumberStyles) as float32 
     194        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out float32) as bool 
     195        def tryParse(result as out float32) as bool 
     196    def abs as float32 
     197    def compareTo(value as float32) as int 
     198    def compareTo(value as Object) as int 
     199    def equals(obj as float32) as bool 
     200    def equals(obj as Object) as bool 
     201    def getHashCode as int 
     202    def getTypeCode as TypeCode 
     203    def isInfinity as bool 
     204    def isNaN as bool 
     205    def isNegativeInfinity as bool 
     206    def isPositiveInfinity as bool 
     207    def max(val2 as float32) as float32 
     208    def min(val2 as float32) as float32 
     209    def sign as int 
     210    def toString(provider as IFormatProvider) as String 
     211    def toString as String 
     212    def toString(format as String, provider as IFormatProvider) as String 
     213    def toString(format as String) as String 
     214 
     215type int8 
     216    shared 
     217        def parse(provider as IFormatProvider) as int8 
     218        def parse(style as NumberStyles, provider as IFormatProvider) as int8 
     219        def parse as int8 
     220        def parse(style as NumberStyles) as int8 
     221        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out int8) as bool 
     222        def tryParse(result as out int8) as bool 
     223    def abs as int8 
     224    def compareTo(obj as Object) as int 
     225    def compareTo(value as int8) as int 
     226    def equals(obj as Object) as bool 
     227    def equals(obj as int8) as bool 
     228    def getHashCode as int 
     229    def getTypeCode as TypeCode 
     230    def max(val2 as int8) as int8 
     231    def min(val2 as int8) as int8 
     232    def sign as int 
     233    def toString(provider as IFormatProvider) as String 
     234    def toString(format as String) as String 
     235    def toString(format as String, provider as IFormatProvider) as String 
     236    def toString as String 
     237 
     238type int16 
     239    shared 
     240        def parse(provider as IFormatProvider) as int16 
     241        def parse(style as NumberStyles, provider as IFormatProvider) as int16 
     242        def parse as int16 
     243        def parse(style as NumberStyles) as int16 
     244        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out int16) as bool 
     245        def tryParse(result as out int16) as bool 
     246    def abs as int16 
     247    def compareTo(value as int16) as int 
     248    def compareTo(value as Object) as int 
     249    def equals(obj as Object) as bool 
     250    def equals(obj as int16) as bool 
     251    def getHashCode as int 
     252    def getTypeCode as TypeCode 
     253    def max(val2 as int16) as int16 
     254    def min(val2 as int16) as int16 
     255    def sign as int 
     256    def toString(format as String) as String 
     257    def toString(provider as IFormatProvider) as String 
     258    def toString as String 
     259    def toString(format as String, provider as IFormatProvider) as String 
     260 
     261type int 
     262    shared 
     263        def parse(provider as IFormatProvider) as int 
     264        def parse(style as NumberStyles, provider as IFormatProvider) as int 
     265        def parse as int 
     266        def parse(style as NumberStyles) as int 
     267        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out int) as bool 
     268        def tryParse(result as out int) as bool 
     269    def abs as int 
     270    def bigMul(b as int) as int64 
     271    def compareTo(value as Object) as int 
     272    def compareTo(value as int) as int 
     273    def divRem(b as int, result as out int) as int 
     274    def equals(obj as Object) as bool 
     275    def equals(obj as int) as bool 
     276    def getHashCode as int 
     277    def getTypeCode as TypeCode 
     278    def max(val2 as int) as int 
     279    def min(val2 as int) as int 
     280    def sign as int 
     281    def toString(provider as IFormatProvider) as String 
     282    def toString(format as String) as String 
     283    def toString(format as String, provider as IFormatProvider) as String 
     284    def toString as String 
     285 
     286type int64 
     287    shared 
     288        def parse(provider as IFormatProvider) as int64 
     289        def parse(style as NumberStyles, provider as IFormatProvider) as int64 
     290        def parse as int64 
     291        def parse(style as NumberStyles) as int64 
     292        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out int64) as bool 
     293        def tryParse(result as out int64) as bool 
     294    def abs as int64 
     295    def compareTo(value as int64) as int 
     296    def compareTo(value as Object) as int 
     297    def divRem(b as int64, result as out int64) as int64 
     298    def equals(obj as int64) as bool 
     299    def equals(obj as Object) as bool 
     300    def getHashCode as int 
     301    def getTypeCode as TypeCode 
     302    def max(val2 as int64) as int64 
     303    def min(val2 as int64) as int64 
     304    def sign as int 
     305    def toString(format as String) as String 
     306    def toString(provider as IFormatProvider) as String 
     307    def toString as String 
     308    def toString(format as String, provider as IFormatProvider) as String 
     309 
     310type uint8 
     311    shared 
     312        def parse(provider as IFormatProvider) as uint8 
     313        def parse(style as NumberStyles, provider as IFormatProvider) as uint8 
     314        def parse as uint8 
     315        def parse(style as NumberStyles) as uint8 
     316        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out uint8) as bool 
     317        def tryParse(result as out uint8) as bool 
     318    def compareTo(value as uint8) as int 
     319    def compareTo(value as Object) as int 
     320    def equals(obj as uint8) as bool 
     321    def equals(obj as Object) as bool 
     322    def getHashCode as int 
     323    def getTypeCode as TypeCode 
     324    def max(val2 as uint8) as uint8 
     325    def min(val2 as uint8) as uint8 
     326    def toString as String 
     327    def toString(format as String, provider as IFormatProvider) as String 
     328    def toString(provider as IFormatProvider) as String 
     329    def toString(format as String) as String 
     330 
     331type uint16 
     332    shared 
     333        def parse(provider as IFormatProvider) as uint16 
     334        def parse(style as NumberStyles, provider as IFormatProvider) as uint16 
     335        def parse as uint16 
     336        def parse(style as NumberStyles) as uint16 
     337        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out uint16) as bool 
     338        def tryParse(result as out uint16) as bool 
     339    def compareTo(value as uint16) as int 
     340    def compareTo(value as Object) as int 
     341    def equals(obj as uint16) as bool 
     342    def equals(obj as Object) as bool 
     343    def getHashCode as int 
     344    def getTypeCode as TypeCode 
     345    def max(val2 as uint16) as uint16 
     346    def min(val2 as uint16) as uint16 
     347    def toString as String 
     348    def toString(format as String, provider as IFormatProvider) as String 
     349    def toString(format as String) as String 
     350    def toString(provider as IFormatProvider) as String 
     351 
     352type uint 
     353    shared 
     354        def parse(provider as IFormatProvider) as uint 
     355        def parse(style as NumberStyles, provider as IFormatProvider) as uint 
     356        def parse as uint 
     357        def parse(style as NumberStyles) as uint 
     358        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out uint) as bool 
     359        def tryParse(result as out uint) as bool 
     360    def compareTo(value as uint) as int 
     361    def compareTo(value as Object) as int 
     362    def equals(obj as uint) as bool 
     363    def equals(obj as Object) as bool 
     364    def getHashCode as int 
     365    def getTypeCode as TypeCode 
     366    def max(val2 as uint) as uint 
     367    def min(val2 as uint) as uint 
     368    def toString as String 
     369    def toString(provider as IFormatProvider) as String 
     370    def toString(format as String) as String 
     371    def toString(format as String, provider as IFormatProvider) as String 
     372 
     373type uint64 
     374    shared 
     375        def parse(provider as IFormatProvider) as uint64 
     376        def parse(style as NumberStyles, provider as IFormatProvider) as uint64 
     377        def parse as uint64 
     378        def parse(style as NumberStyles) as uint64 
     379        def tryParse(style as NumberStyles, provider as IFormatProvider, result as out uint64) as bool 
     380        def tryParse(result as out uint64) as bool 
     381    def compareTo(value as uint64) as int 
     382    def compareTo(value as Object) as int 
     383    def equals(obj as uint64) as bool 
     384    def equals(obj as Object) as bool 
     385    def getHashCode as int 
     386    def getTypeCode as TypeCode 
     387    def max(val2 as uint64) as uint64 
     388    def min(val2 as uint64) as uint64 
     389    def toString as String 
     390    def toString(provider as IFormatProvider) as String 
     391    def toString(format as String) as String 
     392    def toString(format as String, provider as IFormatProvider) as String 
     393}}} 
     394 
     395Note: The above documentation can be generated by enabling some code in !PrimitiveType._bindInt in Types.cobra.