Sather Home Page

Section 8.7.2.1:
WEEKDAYS

immutable class WEEKDAYS < $ENUMS{WEEKDAYS}

$ENUMS{WEEKDAYS} WEEKDAYS
Inheritance Diagram

Formal Types

types

SAME = WEEKDAYS ;
WEEKDAYS = token ;

This enumeration class models the days of the week.


External specifications

The following feature is required to be implemented for this class in accordance with the specification given in $IS_EQ :-


The following feature is required to be implemented for this class in accordance with the specification given in $HASH :-


The following features are required to be implemented for this class in accordance with the specifications given in $BINARY :-


The following featuress are required to be implemented for this class in accordance with the specifications given in $STR :-


The following feature is required to be implemented for this class in accordance with the specification given in $TEXT which is a sub-type of the class $ENUMS{WEEKDAYS} :-


The following features are required to be implemented for this class in accordance with the specifications given in $ANCHORED_FMT :-


The following features are required to be implemented for this class in accordance with the specifications given in $ENUMS{T} :-


Enumeration Values

This enumeration provides values which correspond to the seven days of a week (note that the values given do not necessarily bear a direct relationship to any possible textual representation :-


next

This feature returns the day following self - Sunday following Saturday.

: SAME
Formal Signature
next(self : SAME) res : SAME
Pre-condition

Since the argument is not optional then this pre-condition is vacuously true.

Post-condition
post ((self = Saturday)
         and (res = Sunday))
      or res = create(card(self + 1))

This routine returns the cyclic successor of self (ie Sunday follows Saturday).


previous

This feature returns the day before self - Saturday precedes Sunday!

: SAME
Formal Signature
previous(self : SAME) res : SAME
Pre-condition

Since the argument is not optional then this pre-condition is vacuously true.

Post-condition
post ((self = Sunday)
         and (res = Saturday))
      or res = create(card(self - 1))

This routine returns the cyclic predecessor of self (ie Saturday precedes Sunday).


short_str

This feature returns the the culturally defined short form of the textual representation of self!

short_str (
lib : LIBCHARS
) : STR
Formal Signature
short_str(self : SAME) res : STR
Pre-condition

Since the arguments are not optional then this pre-condition is vacuously true.

Post-condition
post create(res) = self

This routine returns the culturally defined short form textual representation of self in the given encoding and repertoire.


short_str

This feature returns the culturally defined short form text string representation of self.

short_str : STR
Formal Signature
short_str2(self : SAME) res : STR
Pre-condition

Since the argument is not optional then this pre-condition is vacuously true.

Post-condition
post create(res) = self

This routine returns the culturally defined short form textual representation of self in the default encoding and repertoire.


Language Index Library Index Date-Time Index
Comments or enquiries should be made toKeith Hopper.
Page last modified:Friday, 1 June 2001.
Produced with Amaya