![]() |
Section 8.16.1.6: |
![]() |
This page contains the definition of the two generic $FSTRING abstract classes.
![]() |
This abstract class defines a state component which is a set of all instantiations of objects of any class sub-typing from this class in addition to the vdm model types used wherever this class name is used. Note that SAME has to be an instantiated class, not an abstract one.
NOTE | See the important note about vdm state in the notes on vdm-sl usage in this specification. |
This abstract class characterises the concept of all forms of mutable string whether binary, text or other as sequences of the argument class (elements) which must sub-type from $IS_EQ.
This class defines NO features of its own.
![]() |
This abstract class defines a state component which is a set of all instantiations of objects of any class sub-typing from this class in addition to the vdm model types used wherever this class name is used. Note that SAME has to be an instantiated class, not an abstract one.
NOTE | See the important note about vdm state in the notes on vdm-sl usage in this specification. |
This abstract class characterises the concept of mutable non-text strings as sequences of the argument class (elements) which must sub-type from $IS_EQ. The second and third class arguments are the 'corresponding' mutable ($FSTRINGS{ELT}) and immutable (sub-typing from this abstract class) string classes.
This feature carries out a bit copying operation from the given source into self. Copying stops when the source is exhausted or self is full - whichever occurs first.
acopy | ( |
source : STP | |
) |
This routine carries out a bit-pattern copy of the given string into self either until no more bits of self are available or until the source string is exhausted, whichever occurs first.
This feature carries out a bit copying operation from the given source into self. Copying stops when the source is exhausted or self is full - whichever occurs first.
acopy | ( |
source : SAME | |
) |
This routine carries out a bit-pattern copy of the given string into self either until no more bits of self are available or until the source string is exhausted, whichever occurs first.
This feature carries out a bit copying operation from the given source into self. Copying stops when the count is exhausted, the source is exhausted or self is full - whichever occurs first.
This routine carries out a bit-pattern copy of the given string into self either until the count is exhausted, no more bits of self are available or until the source string is exhausted, whichever occurs first.
This feature carries out a bit copying operation from the given source into self. Copying stops when either the count is exhausted, the source is exhausted or self is full - whichever occurs first.
This routine carries out a bit-pattern copy of the given string into self either until count is exhausted, no more bits of self are available or until the source string is exhausted, whichever occurs first.
This feature carries out a bit copying operation from the given source into self starting at the indicated index position in self. Copying stops when the count is exhausted, the source is exhausted or self is full - whichever occurs first.
This routine carries out a bit-pattern copy of the given string into self starting at the given index position in self either until no more bits of self are available or until the source string is exhausted, whichever occurs first.
This feature carries out a bit copying operation from the given source into self starting at the position begin in self. Copying stops when the source is exhausted or self is full - whichever occurs first.
This routine carries out a bit-pattern copy of the given string into self starting at the specified index position in self either until no more bits of self are available or until the source string is exhausted, whichever occurs first.
In order to specify the string appending operations below, the following two auxiliary functions need to be specified. The first function makes use of the second recursively to determine the minimum length for the result of some concatenation. This in turn uses the feature is_full inherited from $FLISTS.
The extend function uses a short cut so that if the original string should become full then the extra space needed is merely what would be needed by the remainder of the tail - if empty nothing or a recursive call to the function.
This is the first of three features which are provided for appending new elements to the string. It is provided for appending a single elemnt, returning the string having done so. Note that the string returned will be a new string if the buffer of self is full when invoked.
plus | ( |
val : ELT | |
) : SAME |
Note that this post-condition makes use of the feature is_full inherited from $FLISTS.
This feature appends the given element onto the end of the sequence of elements in self, returning an object of the same type. This object returned may be self or it may be a new object.
This version of string concatenation is provided to append a mutable string tp self, returning the string having done so. Note that the string returned will be a new string if the buffer of self is not large enough to contain the string to be appended when invoked.
plus | ( |
val : SAME | |
) : SAME |
Note that this post-condition makes use of the feature is_full inherited from $FLISTS in addition to the auxiliary function new_length specified for this abstraction.
This feature appends the given element onto the end of the sequence of elements in self, returning an object of the same type. This object returned may be self or it may be a new object.
This version of string concatenation is provided to append a mutable string tp self, returning the string having done so. Note that the string returned will be a new string if the buffer of self is not large enough to contain the string to be appended when invoked.
plus | ( |
val : STP | |
) : SAME |
Note that this post-condition makes use of the feature is_full inherited from $FLISTS in addition to the auxiliary function new_length specified for this abstraction.
This feature appends the given element onto the end of the sequence of elements in self, returning an object of the same type. This object returned may be self or it may be a new object.
![]() |
Language Index | ![]() |
Library Index | ![]() |
String Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Wednesday, 29 November 2000. |
![]() |