code: public void addObject (int x, int y, Object object)
      {
          Record record = new Record(x, y, object);
  
          // if this is the very first element, we have to insert it
          // straight away because our binary search algorithm doesn't work
          // on empty arrays
          if (_size == 0) {
              _records[_size++] = record;
              return;
          }
  
          // figure out where to insert it
          int ipoint = binarySearch(x);
  
          // expand the records array if necessary
          if (_size >= _records.length) {
              int nsize = _size*2;
              Record[] records = new Record[nsize];
              System.arraycopy(_records, 0, records, 0, _size);
              _records = records;
          }
  
          // shift everything down
          if (ipoint < _size) {
              System.arraycopy(_records, ipoint, _records, ipoint+1,
                               _size-ipoint);
          }
  
          // insert the record
          _records[ipoint] = record;
          _size++;
      }
docs: Adds an object to the tracker.