Example #1
0
 public void addNum(long val, int exp) {
   if (val == 0) exp = 0; // Canonicalize zero
   long t; // Remove extra scaling
   while (exp < 0 && exp > -9999999 && (t = val / 10) * 10 == val) {
     val = t;
     exp++;
   }
   append2(val, exp);
 }
Example #2
0
 public void addNum(long val, int exp) {
   if (isUUID() || isString()) addNA();
   else if (_ds != null) {
     assert _ls == null;
     addNum(val * PrettyPrint.pow10(exp));
   } else {
     if (val == 0) exp = 0; // Canonicalize zero
     long t; // Remove extra scaling
     while (exp < 0 && exp > -9999999 && (t = val / 10) * 10 == val) {
       val = t;
       exp++;
     }
     append2(val, exp);
   }
 }
Example #3
0
 // Fast-path append long data
 void append2(long l, int x) {
   if (_id == null || l != 0) {
     if (_ls == null || sparseLen() == _ls.length) {
       append2slow();
       // again call append2 since calling append2slow might have changed things (eg might have
       // switched to sparse and l could be 0)
       append2(l, x);
       return;
     }
     _ls[sparseLen()] = l;
     _xs[sparseLen()] = x;
     if (_id != null) _id[sparseLen()] = _len;
     set_sparseLen(sparseLen() + 1);
   }
   set_len(_len + 1);
   assert sparseLen() <= _len;
 }
Example #4
0
 public void addNA() {
   append2(0, Integer.MIN_VALUE);
 }
Example #5
0
 public void addEnum(int e) {
   append2(e, Integer.MIN_VALUE + 1);
 }
Example #6
0
 public void addNA() {
   if (isUUID()) addUUID(C16Chunk._LO_NA, C16Chunk._HI_NA);
   else if (isString()) addStr(null);
   else if (_ds != null) addNum(Double.NaN);
   else append2(Long.MAX_VALUE, Integer.MIN_VALUE);
 }
Example #7
0
 public void addCategorical(int e) {
   append2(e, Integer.MIN_VALUE + 1);
 }