PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tutorial/backtracking/logigram/item_item.e

http://github.com/tybor/Liberty
Specman e | 54 lines | 28 code | 8 blank | 18 comment | 1 complexity | bfd9b55ebc59e9b25e92d0e632fbf915 MD5 | raw file
 1-- See the Copyright notice at the end of this file.
 2--
 3class ITEM_ITEM
 4
 5inherit
 6	ITEM
 7
 8creation {ANY}
 9	make
10
11feature {ANY}
12	index: INTEGER
13
14	to_integer: INTEGER is
15		do
16			Result := value
17		end
18
19	make (the_group: like group; the_name: like name; the_index: like index) is
20		require
21			the_group.is_numeric implies the_name.is_integer
22		do
23			group := the_group
24			name := the_name
25			index := the_index
26			if group.is_numeric then
27				value := name.to_integer
28			elseif group.is_ordered then
29				value := the_index
30			end
31		end
32
33	is_off: BOOLEAN is False
34
35feature {}
36	value: INTEGER
37
38end -- class ITEM_ITEM
39--
40-- ------------------------------------------------------------------------------------------------------------------------------
41-- Copyright notice below. Please read.
42--
43-- This file is free software, which comes along with SmartEiffel. This software is distributed in the hope that it will be
44-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
45-- You can modify it as you want, provided this footer is kept unaltered, and a notification of the changes is added.
46-- You are allowed to redistribute it and sell it, alone or as a part of another product.
47--
48-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
49-- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
50--
51-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
52--
53-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
54-- ------------------------------------------------------------------------------------------------------------------------------