RangeDifference.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * New version of the difference engine
  4. *
  5. * Copyright © 2008 Guy Van den Broeck <guy@guyvdb.eu>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. * http://www.gnu.org/copyleft/gpl.html
  21. *
  22. * @file
  23. * @ingroup DifferenceEngine
  24. */
  25. /**
  26. * Alternative representation of a set of changes, by the index
  27. * ranges that are changed.
  28. *
  29. * @ingroup DifferenceEngine
  30. */
  31. class RangeDifference {
  32. /** @var int */
  33. public $leftstart;
  34. /** @var int */
  35. public $leftend;
  36. /** @var int */
  37. public $leftlength;
  38. /** @var int */
  39. public $rightstart;
  40. /** @var int */
  41. public $rightend;
  42. /** @var int */
  43. public $rightlength;
  44. function __construct( $leftstart, $leftend, $rightstart, $rightend ) {
  45. $this->leftstart = $leftstart;
  46. $this->leftend = $leftend;
  47. $this->leftlength = $leftend - $leftstart;
  48. $this->rightstart = $rightstart;
  49. $this->rightend = $rightend;
  50. $this->rightlength = $rightend - $rightstart;
  51. }
  52. }