/test/language/unclassified/aux_jlp8_matrix_rows.e

http://github.com/tybor/Liberty · Specman e · 75 lines · 42 code · 12 blank · 21 comment · 2 complexity · c66bcdac5b8f285ccdbf8a64db79b56e 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_JLP8_MATRIX_ROWS[E -> NUMERIC]
  5. inherit
  6. AUX_JLP8_PROVIDER[AUX_JLP8_ROW_PROVIDER[E]]
  7. redefine is_runnable
  8. end
  9. feature {ANY}
  10. make (m: AUX_JLP8_MATRIX[E])
  11. do
  12. matrix := m
  13. end
  14. start
  15. do
  16. row := 0
  17. if not exhausted then
  18. item := matrix.row(row)
  19. end
  20. end
  21. next
  22. do
  23. row := row + matrix.incr_row
  24. if not exhausted then
  25. item := matrix.row(row)
  26. end
  27. end
  28. exhausted: BOOLEAN
  29. do
  30. Result := row >= matrix.nb_row
  31. end
  32. item: AUX_JLP8_ROW_PROVIDER[E]
  33. is_runnable: BOOLEAN
  34. do
  35. Result := matrix /= Void
  36. end
  37. aborted: BOOLEAN
  38. abort
  39. do
  40. row := matrix.nb_row
  41. aborted := True
  42. end
  43. matrix: AUX_JLP8_MATRIX[E]
  44. row: INTEGER
  45. end -- class AUX_JLP8_MATRIX_ROWS
  46. --
  47. -- ------------------------------------------------------------------------------------------------------------------------------
  48. -- Copyright notice below. Please read.
  49. --
  50. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  51. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  52. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  53. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  54. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  55. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  56. --
  57. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  58. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  59. --
  60. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  61. --
  62. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  63. -- ------------------------------------------------------------------------------------------------------------------------------