/** * If fields list is not null, find and add the fields of this format to * the fields list by iterating through its AttributedCharacterIterator * * @param format * the format to find fields for * @param arg * object to format * @param begin * the index where the string this format has formatted begins */ private void handleFormat(Format format, Object arg, int begin, List<FieldContainer> fields) { if (fields == null) { return; } AttributedCharacterIterator iterator = format.formatToCharacterIterator(arg); while (iterator.getIndex() != iterator.getEndIndex()) { int start = iterator.getRunStart(); int end = iterator.getRunLimit(); Iterator<?> it = iterator.getAttributes().keySet().iterator(); while (it.hasNext()) { AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute) it.next(); Object value = iterator.getAttribute(attribute); fields.add(new FieldContainer(begin + start, begin + end, attribute, value)); } iterator.setIndex(end); } }
while (iterator.getIndex() < end) { Object value = iterator.getAttribute(attribute); int runStart = iterator.getRunStart(attribute); int limit = iterator.getRunLimit(attribute); if ((value instanceof Annotation && runStart >= start && limit <= end)
iterator.setIndex(0); while (iterator.current() != CharacterIterator.DONE) { int start = iterator.getRunStart(attribute); int limit = iterator.getRunLimit(attribute); Object value = iterator.getAttribute(attribute);
/** * Get the index of the first character of the run with * respect to the given attributes containing the current character. * @param attributes the Set of attributes which begins at the returned index. */ public int getRunStart(Set attributes) { return reorderedACI.getRunStart(attributes); }
/** * Get the index of the first character of the run with * respect to the given attribute containing the current character. * @param attribute The attribute for whose appearance the first offset * is requested. */ public int getRunStart(AttributedCharacterIterator.Attribute attribute) { return reorderedACI.getRunStart(attribute); }
/** * Get the index of the first character of the run with * respect to the given attribute containing the current character. * @param attribute The attribute for whose appearance the first offset * is requested. */ public int getRunStart(AttributedCharacterIterator.Attribute attribute) { return reorderedACI.getRunStart(attribute); }
/** * Get the index of the first character of the run with * respect to the given attributes containing the current character. * @param attributes the Set of attributes which begins at the returned index. */ public int getRunStart(Set attributes) { return reorderedACI.getRunStart(attributes); }
/** * Get the index of the first character of the run with * respect to the given attribute containing the current character. * @param attribute The attribute for whose appearance the first offset * is requested. */ public int getRunStart(AttributedCharacterIterator.Attribute attribute) { return reorderedACI.getRunStart(attribute); }
/** * Get the index of the first character of the run with * respect to all attributes containing the current character. */ public int getRunStart() { return reorderedACI.getRunStart(); }
/** * Get the index of the first character of the run with * respect to the given attributes containing the current character. * @param attributes the Set of attributes which begins at the returned index. */ public int getRunStart(Set attributes) { return reorderedACI.getRunStart(attributes); }
/** * Get the index of the first character of the run with * respect to the given attribute containing the current character. * @param attribute The attribute for whose appearance the first offset * is requested. */ public int getRunStart(AttributedCharacterIterator.Attribute attribute) { return Math.max(aci.getRunStart(attribute), begin); }
/** * Get the index of the first character of the run with * respect to all attributes containing the current character. */ public int getRunStart() { return Math.max(aci.getRunStart(), begin); }
/** * Get the index of the first character of the run with respect to * the given attributes containing the current character. * @param attributes the Set of attributes which begins at the * returned index. */ public int getRunStart(Set attributes) { return Math.max(aci.getRunStart(attributes), begin); }
/** * Get the index of the first character of the run with * respect to the given attribute containing the current character. * @param attribute The attribute for whose appearance the first offset * is requested. */ public int getRunStart(AttributedCharacterIterator.Attribute attribute) { return Math.max(aci.getRunStart(attribute), begin); }
/** * Get the index of the first character of the run with * respect to the given attribute containing the current character. * @param attribute The attribute for whose appearance the first offset * is requested. */ public int getRunStart(AttributedCharacterIterator.Attribute attribute) { return Math.max(aci.getRunStart(attribute), begin); }
/** * Get the index of the first character of the run with * respect to all attributes containing the current character. */ public int getRunStart() { return Math.max(aci.getRunStart(), begin); }
/** * Get the index of the first character of the run with * respect to all attributes containing the current character. */ public int getRunStart() { return Math.max(aci.getRunStart(), begin); }
/** * Get the index of the first character of the run with respect to * the given attributes containing the current character. * @param attributes the Set of attributes which begins at the * returned index. */ public int getRunStart(Set attributes) { return Math.max(aci.getRunStart(attributes), begin); }
/** {@inheritDoc} */ public int getRunStart(final Set<? extends Attribute> attributes) { return this.realIterators.get(this.currentList).getRunStart(attributes) + this.currentOffset(); }
/** {@inheritDoc} */ public int getRunStart(final Attribute attribute) { return this.realIterators.get(this.currentList).getRunStart(attribute) + this.currentOffset(); }