![]() |
Section 8.17.3.4:
|
![]() |
types SAME = RUNE ; RUNE = seq1 of CHAR_CODE
This class implements the notion of a logical character which has the semantics associated with such a token in the cultural environment concerned. It is required to satisfy Level 3 conformance to ISO/IEC 10646-1:2000 as defined therein.
The following feature is required to be implemented for this class in accordance with the specification given in $IS_EQ of which $CHAR{RUNE} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $IS_LT{RUNE} of which $CHAR{RUNE} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $IS_NIL of which $CHAR{RUNE} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $NIL of which $CHAR{RUNE} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $STR of which $CHAR{RUNE} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $HASH of which $CHAR{RUNE} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given in $BINARY of which $CHAR{RUNE} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given in $INSTR of which $CHAR{RUNE} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given in $ANCHORED_FMT of which $CHAR{RUNE} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given in $CHAR{RUNE} :-
This class has a single reader routine -
This predicate is provided in order that the validity of the 'number' as a bit-pattern for a code may be ascertained - in respect to the given encoding and repertoire.
valid(num : CARD, lib : LIBCHARS) res : BOOL
Since this is a predicate the pre-condition is vacuously true.
Note that where the code is to occupy sixteen bits all values except the one with all bits set is valid - and for thirty-two bit codes only 31 bits are used and then the value with bit 31 set is not valid.
post res = cases LIBCHARS.my_size(lib) : 2 -> num < HEXTET.Hextet_Max, 4 -> num <= QUADBITS.Quad_Max div 2 end
This routine returns true if and only if the value of num may be interpreted as a character bit-pattern valid in the given encoding and repertoire, otherwise false.
This predicate is provided in order that the validity of the 'number' as a bit-pattern for a code may be ascertained - in respect to the default encoding and repertoire.
valid(num : CARD) res : BOOL
Since this is a predicate the pre-condition is vacuously true.
Note that where the code is to occupy sixteen bit codes all values except the one with all bits set is valid - and for thirty-two bit codes only 31 bits are used and then the value with bit 31 set is not valid.
post res = cases LIBCHARS.my_size(LIBCHARS.default()) : 2 -> num < HEXTET.Hextet_Max, 4 -> num <= QUADBITS.Quad_Max div 2 end
This routine returns true if and only if the value of num may be interpreted as a character bit-pattern valid in the default execution environment encoding and repertoire, otherwise false.
This routine attempts to convert self into the encoding specified by the argument if this is possible, otherwise void is returned.
convert(self : SAME, lib : LIBCHARS) res : [SAME]
Since neither of the arguments is optional, then this pre-condition is vacuously true.
post convert(res,lib(self)) = self or res = nil
This routine converts self into the encoding specified by lib - if this is possible, otherwise returning void.
Since this 'kind' of character is not an immutable class, this copy routine is provided to aid in providing immutable semantics if desired.
copy | : SAME |
copy(self : SAME) res : SAME
Since the argument is not optional then the pre-condition is vacuously true.
post res = self
This routine returns an exact copy of self.
This routine has the same semantics as num_codes - returning the number of codes in self.
size(self : SAME) res : CARD
Since the argument is not optional then the pre-condition is vacuously true.
post res = len self
This routine returns the number of codes in self.
This routine is provided for building a rune from a number of individual codes which, except the first, must all be combining codes.
plus(self : SAME, code : CHAR_CODE) res : SAME
pre CHAR_CODE.lib = lib(self) and CHAR_CODE.is_combining(code)
post res = self ^ create(code)
This routine appends code to self returning the new rune formed.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Text Index |
Comments
or enquiries should be made toKeith Hopper. Page last modified: Friday, 4 May 2001. |
![]() |