/** * Constructs an {@code AttributedString} from a range of the text contained * in the specified {@code AttributedCharacterIterator}, starting at {@code * start} and ending at {@code end}. All attributes will be copied to this * attributed string. * * @param iterator * the {@code AttributedCharacterIterator} that contains the text * for this attributed string. * @param start * the start index of the range of the copied text. * @param end * the end index of the range of the copied text. * @throws IllegalArgumentException * if {@code start} is less than first index of * {@code iterator}, {@code end} is greater than the last * index + 1 in {@code iterator} or if {@code start > end}. */ public AttributedString(AttributedCharacterIterator iterator, int start, int end) { this(iterator, start, end, iterator.getAllAttributeKeys()); }
.getAllAttributeKeys(); if (attributes == null) { return;
/** * Get the keys of all attributes defined on the iterator's text range. */ public Set getAllAttributeKeys() { return reorderedACI.getAllAttributeKeys(); }
/** * Get the keys of all attributes defined on the iterator's text range. */ public Set getAllAttributeKeys() { return reorderedACI.getAllAttributeKeys(); }
/** * Get the keys of all attributes defined on the iterator's text range. */ public Set getAllAttributeKeys() { return reorderedACI.getAllAttributeKeys(); }
/** * Get the keys of all attributes defined on the iterator's text range. */ public Set getAllAttributeKeys() { return aci.getAllAttributeKeys(); // FIXME: not if there are atts outside the substring! }
/** * Get the keys of all attributes defined on the iterator's text range. */ public Set getAllAttributeKeys() { return aci.getAllAttributeKeys(); // FIXME: not if there are atts outside the substring! }
/** * Get the keys of all attributes defined on the iterator's text range. */ public Set getAllAttributeKeys() { return aci.getAllAttributeKeys(); // FIXME: not if there are atts outside the substring! }
public Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys() { return aci.getAllAttributeKeys(); }
/** * Constructs an {@code AttributedString} from a range of the text contained * in the specified {@code AttributedCharacterIterator}, starting at {@code * start} and ending at {@code end}. All attributes will be copied to this * attributed string. * * @param iterator * the {@code AttributedCharacterIterator} that contains the text * for this attributed string. * @param start * the start index of the range of the copied text. * @param end * the end index of the range of the copied text. * @throws IllegalArgumentException * if {@code start} is less than first index of * {@code iterator}, {@code end} is greater than the last * index + 1 in {@code iterator} or if {@code start > end}. */ public AttributedString(AttributedCharacterIterator iterator, int start, int end) { this(iterator, start, end, iterator.getAllAttributeKeys()); }
/** * Constructs an {@code AttributedString} from a range of the text contained * in the specified {@code AttributedCharacterIterator}, starting at {@code * start} and ending at {@code end}. All attributes will be copied to this * attributed string. * * @param iterator * the {@code AttributedCharacterIterator} that contains the text * for this attributed string. * @param start * the start index of the range of the copied text. * @param end * the end index of the range of the copied text. * @throws IllegalArgumentException * if {@code start} is less than first index of * {@code iterator}, {@code end} is greater than the last * index + 1 in {@code iterator} or if {@code start > end}. */ public AttributedString(AttributedCharacterIterator iterator, int start, int end) { this(iterator, start, end, iterator.getAllAttributeKeys()); }
/** * Constructs an {@code AttributedString} from a range of the text contained * in the specified {@code AttributedCharacterIterator}, starting at {@code * start} and ending at {@code end}. All attributes will be copied to this * attributed string. * * @param iterator * the {@code AttributedCharacterIterator} that contains the text * for this attributed string. * @param start * the start index of the range of the copied text. * @param end * the end index of the range of the copied text. * @throws IllegalArgumentException * if {@code start} is less than first index of * {@code iterator}, {@code end} is greater than the last * index + 1 in {@code iterator} or if {@code start > end}. */ public AttributedString(AttributedCharacterIterator iterator, int start, int end) { this(iterator, start, end, iterator.getAllAttributeKeys()); }
/** * Constructs an {@code AttributedString} from a range of the text contained * in the specified {@code AttributedCharacterIterator}, starting at {@code * start} and ending at {@code end}. All attributes will be copied to this * attributed string. * * @param iterator * the {@code AttributedCharacterIterator} that contains the text * for this attributed string. * @param start * the start index of the range of the copied text. * @param end * the end index of the range of the copied text. * @throws IllegalArgumentException * if {@code start} is less than first index of * {@code iterator}, {@code end} is greater than the last * index + 1 in {@code iterator} or if {@code start > end}. */ public AttributedString(AttributedCharacterIterator iterator, int start, int end) { this(iterator, start, end, iterator.getAllAttributeKeys()); }
public boolean usesUnsupportedAttributes(AttributedCharacterIterator aci){ if (unsupportedAttributes == null) return false; Set allAttrs = aci.getAllAttributeKeys(); for (Object allAttr : allAttrs) { if (unsupportedAttributes.contains(allAttr)) { return true; } } return false; }
/** * Constructs an {@code AttributedString} from a range of the text contained * in the specified {@code AttributedCharacterIterator}, starting at {@code * start} and ending at {@code end}. All attributes will be copied to this * attributed string. * * @param iterator * the {@code AttributedCharacterIterator} that contains the text * for this attributed string. * @param start * the start index of the range of the copied text. * @param end * the end index of the range of the copied text. * @throws IllegalArgumentException * if {@code start} is less than first index of * {@code iterator}, {@code end} is greater than the last * index + 1 in {@code iterator} or if {@code start > end}. */ public AttributedString(AttributedCharacterIterator iterator, int start, int end) { this(iterator, start, end, iterator.getAllAttributeKeys()); }
/** {@inheritDoc} */ public Set<Attribute> getAllAttributeKeys() { final Set<Attribute> retVal = new HashSet<Attribute>(); for (final AttributedCharacterIterator ri : this.realIterators) { retVal.addAll(ri.getAllAttributeKeys()); } return retVal; }
public boolean usesUnsupportedAttributes(AttributedCharacterIterator aci){ if (unsupportedAttributes == null) return false; Set allAttrs = aci.getAllAttributeKeys(); Iterator iter = allAttrs.iterator(); while (iter.hasNext()) { if (unsupportedAttributes.contains(iter.next())) { return true; } } return false; }
private void buildAttributeTables(AttributedCharacterIterator aci) { allAttributes = aci.getAllAttributeKeys(); int length = aci.getEndIndex() - aci.getBeginIndex(); mapList = new ArrayList(length); charInRun = new int[length]; char c = aci.first(); char[] chars = new char[length]; for (int i = 0; i < length; ++i) { chars[i] = c; charInRun[i] = SINGLETON; /* * XXX TODO:loosen assumption, initially each character * has its own attribute map. */ mapList.set(i, new HashMap(aci.getAttributes())); c = aci.next(); } simpleString = new String(chars); }
private void buildAttributeTables(AttributedCharacterIterator aci) { allAttributes = aci.getAllAttributeKeys(); int length = aci.getEndIndex() - aci.getBeginIndex(); mapList = new ArrayList(length); charInRun = new int[length]; char c = aci.first(); char[] chars = new char[length]; for (int i = 0; i < length; ++i) { chars[i] = c; charInRun[i] = SINGLETON; /* * XXX TODO:loosen assumption, initially each character * has its own attribute map. */ mapList.set(i, new HashMap(aci.getAttributes())); c = aci.next(); } simpleString = new String(chars); }
private void buildAttributeTables(AttributedCharacterIterator aci) { allAttributes = aci.getAllAttributeKeys(); int length = aci.getEndIndex() - aci.getBeginIndex(); mapList = new ArrayList(length); charInRun = new int[length]; char c = aci.first(); char[] chars = new char[length]; for (int i = 0; i < length; ++i) { chars[i] = c; charInRun[i] = SINGLETON; /* * XXX TODO:loosen assumption, initially each character * has its own attribute map. */ mapList.set(i, new HashMap(aci.getAttributes())); c = aci.next(); } simpleString = new String(chars); }