![]() |
Section 8.16.1.2: |
![]() |
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 models the concept of a searchable immutable string of any object kind which inherits from $IS_EQ. The features include forward and backward searching as well as matching and prefix operations.
It is frequently necessary to be able to recognise a key of some kind which indicates the start of some known sequence of data. This feature is provided to enable this to be done as needed.
This predicate returns true if and only if try is identical to the elements starting at the beginning of self.
This feature enables the first occurrence of some individual element value to be found in the string.
Since the domain of the result is larger than that of the string length, the pre-condition is vacuously true.
This feature returns the index in self at which the first occurrence of try is to be found. If there is no such occurrence then CARD::maxval shall be returned.
This feature enables the first occurrence of some individual element value to be found in the string, starting the search at the given index.
This feature returns the index in self at which the first occurrence of try is to be found, starting to search at the given start index. If there is no such occurrence then CARD::maxval shall be returned.
This feature returns the index of the first element of the first occurrence of try in self.
Since the domain of the result is larger than that of the string length, the pre-condition is vacuously true.
This feature returns the index in self at which the first occurrence of try is to be found. If there is no such occurrence then CARD::maxval shall be returned.
This feature enables finding the first occurrence of the start of the first occurrence of try to be found in the string, starting the search at the given index.
This feature returns the index in self at which the first occurrence of try is to be found, starting to search at the given start index. If there is no such occurrence then CARD::maxval shall be returned.
This feature enables the first occurrence of some individual element value to be found in the string starting to search backwards from the end of the string.
search_backwards | ( |
try : ELT | |
) : CARD |
Since the domain of the result is larger than that of the string length, the pre-condition is vacuously true.
This feature returns the index in self at which a backward search starting from the end first finds try. If there is no such occurrence then CARD::maxval shall be returned.
This feature enables the next occurrence of try is to be found starting a backward search from the given index. Note that if the element is found at the starting index that is returned.
search_backwards | ( |
try : ELT | |
start : CARD | |
) : CARD |
This feature returns the index in self at which the next occurrence of elem is to be found, searching backwards from the given start index. If there is no such occurrence then CARD::maxval shall be returned.
This feature returns the index of the first element of the two strings which is different.
Matching elements at the same index in self and other, this feature returns the index of the first element of self and other which have different element values; CARD::maxval is returned if self is a prefix of other.
![]() |
Language Index | ![]() |
Library Index | ![]() |
String Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Thursday, 30 November 2000. |
![]() |