Beispiel #1
0
 // Fast-path append double data
 public void addNum(double d) {
   if (isUUID() || isString()) {
     addNA();
     return;
   }
   if (_id == null || d != 0) {
     if (_ls != null) switch_to_doubles();
     if (_ds == null || sparseLen() >= _ds.length) {
       append2slowd();
       // call addNum again since append2slow might have flipped to sparse
       addNum(d);
       assert sparseLen() <= _len;
       return;
     }
     if (_id != null) _id[sparseLen()] = _len;
     _ds[sparseLen()] = d;
     set_sparseLen(sparseLen() + 1);
   }
   set_len(_len + 1);
   assert sparseLen() <= _len;
 }
Beispiel #2
0
 // Fast-path append double data
 public void addNum(double d) {
   if (_ds == null || _len >= _ds.length) append2slowd();
   _ds[_len++] = d;
   _len2++;
 }