/test/language/unclassified/aux_generic7ht.e

http://github.com/tybor/Liberty · Specman e · 108 lines · 50 code · 12 blank · 46 comment · 0 complexity · e7d408e419debd03452126b566de333b 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_GENERIC7HT[K -> HASHABLE, G]
  5. inherit
  6. AUX_GENERIC7XCT[G]
  7. rename item as item_for_iteration
  8. end
  9. insert
  10. -- *** It was an inherit in Original realease. (Vincent Croizier, 03/11/2004) ***
  11. AUX_GENERIC7LL[G]
  12. rename make as ll_make,
  13. forth as ll_forth,
  14. start as ll_start,
  15. item as item_for_iteration,
  16. has as ll_has,
  17. put as ll_put
  18. export {} ll_make, ll_forth, ll_start, ll_has, ll_put, extend
  19. end
  20. create {ANY}
  21. make
  22. feature {ANY}
  23. make (sz: INTEGER)
  24. do
  25. ll_make
  26. create keys.make
  27. end
  28. put (x: G; k: K)
  29. do
  30. extend(x)
  31. keys.extend(k)
  32. end
  33. -- item(k : K): G
  34. -- local
  35. -- c: CURSOR;
  36. -- do
  37. -- from
  38. -- c := cursor;
  39. -- start;
  40. -- until
  41. -- keys.after or
  42. -- keys.item.is_equal(k)
  43. -- loop
  44. -- forth;
  45. -- end; -- loop
  46. -- if not after then
  47. -- Result := item_for_iteration;
  48. -- end;
  49. -- go_to(c);
  50. -- end; -- item
  51. key_for_iteration: K
  52. do
  53. Result := keys.item
  54. end
  55. forth
  56. do
  57. ll_forth
  58. keys.forth
  59. end
  60. start
  61. do
  62. ll_start
  63. keys.start
  64. end
  65. has (x: K): BOOLEAN
  66. do
  67. Result := keys.has(x)
  68. end
  69. -- go_to(c: CURSOR)
  70. -- do
  71. -- ll_go_to(c);
  72. -- keys.go_to(c);
  73. -- end;
  74. feature {}
  75. keys: AUX_GENERIC7LL[K]
  76. invariant
  77. -- *** same_count: keys.count = count;
  78. end -- class AUX_GENERIC7HT
  79. --
  80. -- ------------------------------------------------------------------------------------------------------------------------------
  81. -- Copyright notice below. Please read.
  82. --
  83. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  84. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  85. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  86. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  87. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  88. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  89. --
  90. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  91. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  92. --
  93. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  94. --
  95. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  96. -- ------------------------------------------------------------------------------------------------------------------------------