This project has moved. For the latest updates, please go here.

Class Magnitude

superclass: Object;
instanceArchitecture: #Abstract

Page still under construction; sorry about that.

Instance Methods

	protocol: #comparing method:
	[## > comparand
	
		^comparand < self
	];
			
	protocol: #comparing method:
	[## < comparand
	
			"Most subclasses will implement #< as a primitive, so this is the fallback implementation."
			
			^(self compareTo: comparand) < 0
	];
				
	protocol: #comparing method:
	[## = comparand
	
			"Most subclasses will implement #= as a primitive, so this is the fallback implementation."
	
			^(self compareTo: comparand) = 0
	];
		
	protocol: #comparing method:
	[## <= comparand
	
			^self < comparand or: [self = comparand]
	];
	
	protocol: #comparing method:
	[## >= comparand
	
			^self > comparand or: [self = comparand]
	];
				
	protocol: #querying method:
	[## between: minValue and: maxValue
	
		"Answer whether the receiver is greater than or equal to <minValue> and also less than or equal to <maxValue>"
		
		^(self < minValue or: [maxValue < self]) not
	]

Last edited Jun 6, 2014 at 7:28 AM by Strategesis, version 2