[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/include/prototype-1.4.0/src/ -> range.js (source)

   1  ObjectRange = Class.create();
   2  Object.extend(ObjectRange.prototype, Enumerable);
   3  Object.extend(ObjectRange.prototype, {
   4    initialize: function(start, end, exclusive) {
   5      this.start = start;
   6      this.end = end;
   7      this.exclusive = exclusive;
   8    },
   9    
  10    _each: function(iterator) {
  11      var value = this.start;
  12      do {
  13        iterator(value);
  14        value = value.succ();
  15      } while (this.include(value));
  16    },
  17    
  18    include: function(value) {
  19      if (value < this.start) 
  20        return false;
  21      if (this.exclusive)
  22        return value < this.end;
  23      return value <= this.end;
  24    }
  25  });
  26  
  27  var $R = function(start, end, exclusive) {
  28    return new ObjectRange(start, end, exclusive);
  29  }


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7