/test/language/unclassified/aux_ph01_splay_dictionary_iterator.e
Specman e | 78 lines | 35 code | 9 blank | 34 comment | 0 complexity | accb826d2074b83e3214309d9a8090e4 MD5 | raw file
1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries. 2-- See the Copyright notice at the end of this file. 3-- 4class AUX_PH01_SPLAY_DICTIONARY_ITERATOR[I -> COMPARABLE] 5 -- 6 -- The iterator for AUX_PH01_SPLAY_DICTIONARY over the keys. 7 -- 8 -- Copyright (C) Philip Malin 2000. 9 -- 10 11create {ANY} 12 make 13 14feature {ANY} 15 make (sd: AUX_PH01_SPLAY_DICTIONARY[INTEGER, I]) 16 do 17 cont := sd 18 start 19 ensure 20 cont = sd 21 end 22 23feature {ANY} 24 start 25 -- Positions the iterator to the first object in the 26 -- aggregate to be traversed. 27 do 28 end 29 30 is_off: BOOLEAN 31 -- Returns true when there are no more objects in the 32 -- sequence. 33 do 34 Result := node = Void 35 end 36 37 index: I 38 -- Returns the index of the object at the current position in the 39 -- sequence. 40 require 41 not is_off 42 do 43 Result := node.index 44 end 45 46 next 47 -- Positions the iterator to the next object in the 48 -- sequence. 49 require 50 not is_off 51 do 52 node := cont.next_highest(node) 53 end 54 55feature {} 56 cont: AUX_PH01_SPLAY_DICTIONARY[INTEGER, I] 57 58 node: AUX_PH01_SPLAY_DICTIONARY_ITEM[INTEGER, I] 59 60end -- class AUX_PH01_SPLAY_DICTIONARY_ITERATOR 61-- 62-- ------------------------------------------------------------------------------------------------------------------------------ 63-- Copyright notice below. Please read. 64-- 65-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 66-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 67-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 68-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 69-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 70-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 71-- 72-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 73-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 74-- 75-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 76-- 77-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 78-- ------------------------------------------------------------------------------------------------------------------------------