示例#1
0
 // Append a String, stored in _ss & _is
 public void addStr(ValueString str) {
   if (_id == null || str != null) {
     if (_is == null || sparseLen() >= _is.length) {
       append2slowstr();
       addStr(str);
       assert sparseLen() <= _len;
       return;
     }
     if (str != null) {
       if (_id != null) _id[sparseLen()] = _len;
       _is[sparseLen()] = _sslen;
       set_sparseLen(sparseLen() + 1);
       append_ss(str);
     } else if (_id == null) {
       _is[sparseLen()] = CStrChunk.NA;
       set_sparseLen(sparseLen() + 1);
     }
   }
   set_len(_len + 1);
   assert sparseLen() <= _len;
 }
示例#2
0
 // Append a string, store in _ss & _is
 public void addStr(Object str) {
   if (_id == null || str != null) {
     if (_is == null || sparseLen() >= _is.length) {
       append2slowstr();
       addStr(str);
       assert sparseLen() <= _len;
       return;
     }
     if (str != null) {
       if (_id != null) _id[sparseLen()] = _len;
       _is[sparseLen()] = _sslen;
       set_sparseLen(sparseLen() + 1);
       if (str instanceof BufferedString) append_ss((BufferedString) str);
       else // this spares some callers from an unneeded conversion to BufferedString first
       append_ss((String) str);
     } else if (_id == null) {
       _is[sparseLen()] = CStrChunk.NA;
       set_sparseLen(sparseLen() + 1);
     }
   }
   set_len(_len + 1);
   assert sparseLen() <= _len;
 }