summaryrefslogtreecommitdiffstats
path: root/eiffel-fragen/nachbedingung/counter.e
blob: db93ce710f749464b8284294fddd9445712c5f62 (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
class
               COUNTER

feature -- Access

    item: INTEGER
                          -- Counter's value.

feature -- Element change

    set (some_value: INTEGER) is
            -- Set value of counter to some_value.
             do
                         item := some_value
             ensure
             			 checkval > 0
             end

    get: INTEGER is
    		-- Get value of counter
    		do
    			Result := item
    		end

    checkval: INTEGER is
    		-- Get value of counter
    		do
    			Result := item
    		end
end