blob: 487422e5b7a615c3da94d78fbf28d164c5cafb6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
-- File: MoniTool_ElemHasher.cdl
-- Created: Fri Nov 4 11:06:49 1994
-- Author: Christian CAILLET
-- <cky@anion>
---Copyright: Matra Datavision 1994
class ElemHasher from MoniTool
---Purpose : ElemHasher defines HashCode for Element, which is : ask a
-- Element its HashCode ! Because this is the Element itself
-- which brings the HashCode for its Key
--
-- This class complies to the template given in TCollection by
-- MapHasher itself
uses Element
is
HashCode (myclass; K : Element; Upper : Integer) returns Integer;
---Purpose : Returns a HashCode in the range <0,Upper> for a Element :
-- asks the Element its HashCode then transforms it to be in the
-- required range
IsEqual (myclass; K1, K2 : Element) returns Boolean;
---Purpose : Returns True if two keys are the same.
-- The test does not work on the Elements themselves but by
-- calling their methods Equates
end ElemHasher;
|