Sather Home Page

Section 8.7.2.3:
MONTHS

immutable class MONTHS < $ENUMS{MONTHS}

$ENUMS{MONTHS} MONTHS
Inheritance Diagram

Formal Types

types

SAME = MONTHS ;
MONTHS = token ;

This enumeration class models the months of the Gregorian calendar year.


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{MONTHS} :-


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 Gregorian calendar months :-


next

This feature returns the month following self - January following December.

: 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 = December)
         and (res = January))
      or res = create(card(self + 1))

This routine returns the cyclic successor of self (ie January follows December.


previous

This feature returns the month before self - December precedes January!

: 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 = January)
         and (res = December))
      or res = create(card(self - 1))

This routine returns the cyclic predecessor of self (ie December precedes January.


short_str

This feature returns the culturally defined short form 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