/** * 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! */ 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; } }
/** * 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! */ 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; } }
createRunAttributeDataVectors(); Vector newRunAttributes = new Vector(attributeCount); Vector newRunAttributeValues = new Vector(attributeCount);
createRunAttributeDataVectors(); Vector newRunAttributes = new Vector(attributeCount); Vector newRunAttributeValues = new Vector(attributeCount);
private synchronized void addAttributeImpl(Attribute attribute, Object value, int beginIndex, int endIndex) { // make sure we have run attribute data vectors if (runCount == 0) { createRunAttributeDataVectors(); } // break up runs if necessary int beginRunIndex = ensureRunBreak(beginIndex); int endRunIndex = ensureRunBreak(endIndex); addAttributeRunData(attribute, value, beginRunIndex, endRunIndex); }
private synchronized void addAttributeImpl(Attribute attribute, Object value, int beginIndex, int endIndex) { // make sure we have run attribute data vectors if (runCount == 0) { createRunAttributeDataVectors(); } // break up runs if necessary int beginRunIndex = ensureRunBreak(beginIndex); int endRunIndex = ensureRunBreak(endIndex); addAttributeRunData(attribute, value, beginRunIndex, endRunIndex); }