# Section 8.14.1.9:
$ANCHORED_FMT

###### abstract class $ANCHORED_FMT < $FMT

#### Formal Definitions

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.

types
SAME = object_type ;
$ANCHORED_FMT = set of object_type
<> state
multi : $ANCHORED_STR
inv multi_types ==
forall obj in set multi_types & sub_type($ANCHORED_FMT,obj)

NOTE | See the important note about vdm state in the notes on vdm-sl usage in this specification.

This abstract class models the abstraction which defines features for producing a formatted text representation where the format descriptor specifies an anchor point in the value for purposes of text layout - for which two variants are provided.

#### fmt

This routine is provided for use by the formatting facilities of the Representation section of this library. It is included here since this class provides the string conversion facility. The format descriptor may be used directly, however, since it is produced as part of the formatting operation - although this is not expected to be common usage.

fmt | (
| fmt : ANCHORED_DESCR ;
| lib : LIBCHARS
| ) : STR

##### Formal Signature

fmt1(self : SAME, format : ANCHORED_DESCR, lib : LIBCHARS) res : STR

##### Post-condition

The very nature of this operation, being dynamically determinable during execution, only provides for no formally describable definition post-condition, rather the informal statement that a formatted representation of self shall be returned.

This routine returns the formatted string representation of self in accordance with the string format in the given repertoire and encoding. It is required that each possible value representation of an object sub-typing from this shall be distinguishable from every other value representation.

#### fmt

This version of fmt creates the result in the culture and coding of the current execution environment.

fmt | (
| fmt : ANCHORED_DESCR ;
| ) : STR

##### Formal Signature

fmt2(self : SAME, format : ANCHORED_DESCR) res : STR

##### Post-condition

The very nature of this operation, being dynamically determinable during executioin only provides for no realisable formal specification post-condition, rather the informal statement that a formatted representation of self shall be returned.

This routine returns the formatted string representation of self in accordance with the string format in the default repertoire and encoding. It is required that each possible value representation of an object sub-typing from this shall be distinguishable from every other value representation.

| Language Index |  | Library Index |  | Representation Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Monday, 13 November 2000. |