Environment: Siren
Instances of the OrdinalMagnitude classes are order-only magnitudes.
Each subclass may decide whether instances or the class will hold the table of relationships.
The decision should be made on the basis of the expected number of magnitude instances and the sparseness of their relationships.
See the subclass' class examples.
Instance Variable:
Class Instance Variable:
accessing
table
Table
table
Answer the receiver's loop-up table--its or the class'.
value
Signal an error.
value: theValue
Signal an error.
initialize-release
Release the receiver's table.
printing
Print the receiver as an ordinal magnitude.
converting
Answer that it is an error to attempt coercion with ordinal magnitudes.
ordering
Answer whether the receiver is less than the argument.
<< anotherOMag
Specify that the receiver is less than the argument.
<= anotherOMag
Answer whether the receiver is less than or equal to the argument.
=< anotherOMag
Specify that the receiver is less than or equal to the argument.
== anotherOMag
Specify that the receiver is equal to the argument.
=> anotherOMag
Specify that the receiver is greater than or equal to the argument.
=? anotherOMag
Answer whether the receiver is equal to the argument.
> anotherOMag
Answer whether the receiver is greater than the argument.
>= anotherOMag
Answer whether the receiver is greater than or equal to the argument.
>> anotherOMag
Specify that the receiver is greater than the argument.
arithmetic
Answer that it is an error to attempt arithmetic with ordinal magnitudes.
+ aValue
Answer that it is an error to attempt arithmetic with ordinal magnitudes.
- aValue
Answer that it is an error to attempt arithmetic with ordinal magnitudes.
/ aValue
Answer that it is an error to attempt arithmetic with ordinal magnitudes.
= aValue
Answer whether the receiver and the argument are equivalent.
MetaClass: OrdinalMagnitude class
table access
Answer the class' instance look-up table.
values
Answer the sorted values.
instance creation
Answer a new instance and, if it's in use, add it to the table.
value: aValue
Answer an instance
class initialization
Release the shared class table and all instances.
useTable
Set up a shared class table for all instances.