code: private void setAttributes(Map attrs, int offset) {
          if (runCount == 0) {
              createRunAttributeDataVectors();
          }
  
          int index = ensureRunBreak(offset, false);
          int size;
  
          if (attrs != null && (size = attrs.size()) > 0) {
              Vector runAttrs = new Vector(size);
              Vector runValues = new Vector(size);
              Iterator iterator = attrs.entrySet().iterator();
  
              while (iterator.hasNext()) {
                  Map.Entry entry = (Map.Entry)iterator.next();
  
                  runAttrs.add(entry.getKey());
                  runValues.add(entry.getValue());
              }
              runAttributes[index] = runAttrs;
              runAttributeValues[index] = runValues;
          }
      }
docs: Sets the attributes for the range from offset to the next run break
  (typically the end of the text) to the ones specified in attrs.
  This is only meant to be called from the constructor!