frost.core

Class Char32

    └ Value
         └ Immutable
             └ Object

Implemented Interfaces:

Represents any Unicode codepoint in the entire range from 0 to 1,114,112.

A single-codepoint string literal may be used wherever a Char32 is expected. That is, it is legal to write:

def c:Char32 := "A"

Note that a string which visually appears to be a single character may in fact consist of more than one Unicode codepoint, and thus not be accepted as a Char32 literal.

Source Code:
View Source

Class Method Summary

-- multiply operator --
*(count:Int, char:Char32):String
Returns a string consisting of count copies of the given character.

Initializer Summary

init(value:Int32):Char32
Creates a Char32 with the specified codepoint.

Field Summary

isWhitespace:Bit
true if this character is whitespace.
isDigit:Bit
true if this character is a numeric digit.
asChar8:Char8
This character converted to a Char8.
asChar16:Char16
This character converted to a Char16.
asInt8:Int8
This character's codepoint converted to an 8 bit signed number.
asInt16:Int16
This character's codepoint converted to a 16 bit signed number.
asInt32:Int32
This character's codepoint converted to a 32 bit signed number.
asInt64:Int64
This character's codepoint converted to a 64 bit signed number.
asInt:Int
This character's codepoint converted to an Int.
asUInt8:UInt8
This character's codepoint converted to an 8 bit unsigned number.
asUInt16:UInt16
This character's codepoint converted to a 16 bit unsigned number.
asUInt32:UInt32
This character's codepoint converted to a 32 bit unsigned number.
asUInt64:UInt64
This character's codepoint converted to a 64 bit unsigned number.
asUInt:UInt
This character's codepoint converted to a UInt.
toChar8:Char8
This character converted to a Char8.
toChar16:Char16
This character converted to a Char16.
toInt8:Int8
This character's codepoint converted to an 8 bit signed number.
toInt16:Int16
This character's codepoint converted to a 16 bit signed number.
toInt32:Int32
This character's codepoint converted to a 32 bit signed number.
toInt64:Int64
This character's codepoint converted to a 64 bit signed number.
toInt:Int
This character's codepoint converted to an Int.
toUInt8:UInt8
This character's codepoint converted to an 8 bit unsigned number.
toUInt16:UInt16
This character's codepoint converted to a 16 bit unsigned number.
toUInt32:UInt32
This character's codepoint converted to a 32 bit unsigned number.
toUInt64:UInt64
This character's codepoint converted to a 64 bit unsigned number.
toUInt:UInt
This character's codepoint converted to a UInt.
Inherited Fields:

Instance Method Summary

-- subtract operator --
-(other:Char32):Int32
Returns the difference between the codepoints of two Char32s.
-- subtract operator --
-(other:Char32):Int
Returns the difference between the codepoints of two Char32s.
-- equals operator --
=(other:Char32):Bit
Returns true if these objects are equal.
-- not equal operator --
!=(other:Char32):Bit
Returns true if these objects are not equal.
-- less than operator --
<(other:Char32):Bit
-- greater than operator --
>(other:Char32):Bit
-- less than or equal operator --
<=(other:Char32):Bit
-- greater than or equal operator --
>=(other:Char32):Bit
-- multiply operator --
*(count:Int):String
Returns a string consisting of count copies of this character.

Initializers

@pre(value >= 0 & value < 1114112)
init (value:Int32
):Char32

Creates a Char32 with the specified codepoint.

Parameters:
value - value of type Int32

Fields

property isWhitespace:Bit

true if this character is whitespace.

property isDigit:Bit

true if this character is a numeric digit.

property asChar8:Char8

This character converted to a Char8. If this number is not in the range of a Char8, a safety violation occurs.

property asChar16:Char16

This character converted to a Char16. If this number is not in the range of a Char16, a safety violation occurs.

property asInt8:Int8

This character's codepoint converted to an 8 bit signed number. If this number is not in the range of an 8 bit signed number, a safety violation occurs.

property asInt16:Int16

This character's codepoint converted to a 16 bit signed number. If this number is not in the range of a 16 bit signed number, a safety violation occurs.

property asInt32:Int32

This character's codepoint converted to a 32 bit signed number.

property asInt64:Int64

This character's codepoint converted to a 64 bit signed number.

property asInt:Int

This character's codepoint converted to an Int.

property asUInt8:UInt8

This character's codepoint converted to an 8 bit unsigned number. If this number is not in the range of an 8 bit unsigned number, a safety violation occurs.

property asUInt16:UInt16

This character's codepoint converted to a 16 bit unsigned number. If this number is not in the range of a 16 bit unsigned number, a safety violation occurs.

property asUInt32:UInt32

This character's codepoint converted to a 32 bit unsigned number.

property asUInt64:UInt64

This character's codepoint converted to a 64 bit unsigned number.

property asUInt:UInt

This character's codepoint converted to a UInt.

property toChar8:Char8

This character converted to a Char8. If this number is not in the range of a Char8, it silently overflows.

property toChar16:Char16

This character converted to a Char16. If this number is not in the range of a Char16, it silently overflows.

property toInt8:Int8

This character's codepoint converted to an 8 bit signed number. If this number is not in the range of an 8 bit signed number, it silently overflows.

property toInt16:Int16

This character's codepoint converted to a 16 bit signed number. If this number is not in the range of a 16 bit signed number, it silently overflows.

property toInt32:Int32

This character's codepoint converted to a 32 bit signed number.

property toInt64:Int64

This character's codepoint converted to a 64 bit signed number.

property toInt:Int

This character's codepoint converted to an Int.

property toUInt8:UInt8

This character's codepoint converted to an 8 bit unsigned number. If this number is not in the range of an 8 bit unsigned number, it silently overflows.

property toUInt16:UInt16

This character's codepoint converted to a 16 bit unsigned number. If this number is not in the range of a 16 bit unsigned number, it silently overflows.

property toUInt32:UInt32

This character's codepoint converted to a 32 bit unsigned number.

property toUInt64:UInt64

This character's codepoint converted to a 64 bit unsigned number.

property toUInt:UInt

This character's codepoint converted to a UInt.

Class Methods

-- multiply operator --
@class
function * (count:Int,
 char:Char32
):String

Returns a string consisting of count copies of the given character.

Parameters:
count - value of type Int
char - value of type Char32

Instance Methods

-- subtract operator --
function - (other:Char32
):Int32

Returns the difference between the codepoints of two Char32s.

Parameters:
other - value of type Char32
-- subtract operator --
function - (other:Char32
):Int

Returns the difference between the codepoints of two Char32s.

Parameters:
other - value of type Char32
-- equals operator --
@override
function = (other:Char32
):Bit

Returns true if these objects are equal.

Parameters:
other - value of type Char32
Overrides:
frost.core.Equatable.=
-- not equal operator --
@override
function != (other:Char32
):Bit

Returns true if these objects are not equal.

Parameters:
other - value of type Char32
Overrides:
frost.core.Equatable.!=
-- less than operator --
@override
function < (other:Char32
):Bit
Parameters:
other - value of type Char32
-- greater than operator --
@override
function > (other:Char32
):Bit
Parameters:
other - value of type Char32
-- less than or equal operator --
@override
function <= (other:Char32
):Bit
Parameters:
other - value of type Char32
-- greater than or equal operator --
@override
function >= (other:Char32
):Bit
Parameters:
other - value of type Char32
-- multiply operator --
function * (count:Int
):String

Returns a string consisting of count copies of this character.

Parameters:
count - value of type Int