/test/language/unclassified/aux_ph01_splay_dictionary_iterator.e

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