Methods of the system type objects
Here below are the methods accepted by the objects of a system type
and a list of allowed types to which they can be mapped.
Examples of the use of methods on the system objects:
Examples of type conversion:
For more about system types and for a lists of accepted operators see Data types.
For methods accepted by: arrays see Arrays,
vector see Vector of values,
and for a sheet object see Sheet object.
Integer number -
Integer object accepts methods:
method | parameters | description | result |
binaryRep | () | returns array of 8 bytes, that represents 64-bit integer | array of bytes |
fromBinaryRep | (byteArr) | returns 64-bit integer value from array of 8 bytes | integer |
Object of
dest type | conversion description |
bool | returns |
byte | makes byte from the first (lowest) 8 bits of integer |
char | returns character of given value |
float | returns floating point value |
string | returns string with a numeric value in decimal system |
Text value -
String object accepts methods:
method | parameters | description | result |
byteLength | () | returns number of bytes in UTF-8 string representation | integer |
byteAt | (pos) | returns byte at given position in UTF-8 string representation;
position starts from 0 to byteLength-1 |
byte |
charLength | () | returns number of characters in string
(notice, that this is slow method, because it must count characters from UTF-8 representation) |
integer |
charAt | (pos) | returns character at given position;
position starts from 0 to charLength-1 |
char |
length | () | returns length of the string;
this is the same as |
integer |
subString | (from,count) | returns substring, that contains characters from string,
starting at given position, of given length |
string |
getUniq | () | returns a unique string object (in given runtime envitonment)
that is equal to given string |
string |
newString | (...) | returns new string object,
that contains data from parameters |
string |
newSheet | (...) | returns new sheet object,
that contains data from parameters |
sheet |
Object of
dest type | conversion description |
byte[] | returns array of bytes in UTF-8 representation |
char[] | returns array of characters |
sheet | returns new sheet object that contains string |
byte | returns first byte in UTF-8 representation |
char | returns first character of the string |
bool | converts "true" to otherwhise it throws exception |
int | parsing an integer number from string |
float | parsing a floating point number from string |
Boolean value -
Boolean object accepts no methods.
Object of
dest type | conversion description |
int | returns 1 for |
string | returns "true" for |
byte | conversion through integer type |
char | conversion through integer type |
float | conversion through integer type |
Character -
Character object accepts no methods.
Object of
dest type | conversion description |
int | returns numeric value of character |
byte | returns byte, when numeric value is between 0 and 255;
otherwise throws exception |
byte[] | returns array of bytes of UTF-8 char representation |
string | returns string that contains single character |
bool | conversion through integer type |
float | conversion through integer type |
Byte -
Byter object accepts no methods.
Object of
dest type | conversion description |
int | returns integer of the same value |
bool | conversion through integer type |
char | conversion through integer type |
float | conversion through integer type |
string | conversion through integer type |
Floating point number -
Floating point number object accepts methods:
method | parameters | description | result |
binaryRep | () | returns array of 8 bytes, that represents 64-bit float | array of bytes |
fromBinaryRep | (byteArr) | returns 64-bit float value from array of 8 bytes | float |
Object of
dest type | conversion description |
bool | returns |
int | rounds float number to the integer;
throws exception when value is out of range |
string | writes number in decimal system to the six places after dot;
last zeros in representation will cutted, except first zero |
byte | conversion through integer type |
char | conversion through integer type |
Many mathematical functions on the float value are available from the math library, see Math linked library.