/** * Returns a set of attributes present in the {@code AttributedString}. * An empty set returned indicates that no attributes where defined. * * @return a set of attribute keys that may be empty. */ public java.util.Set <AttributedCharacterIteratorNS.Attribute> getAllAttributeKeys() { if (begin == 0 && end == attrString.text.Length && attributesAllowed == null) { return(attrString.attributeMap.keySet()); } java.util.Set <AttributedCharacterIteratorNS.Attribute> result = new java.util.HashSet <AttributedCharacterIteratorNS.Attribute>();//(attrString.attributeMap.size() * 4 / 3) + 1); java.util.Iterator <java.util.MapNS.Entry <AttributedCharacterIteratorNS.Attribute, java.util.List <IAC_Range> > > it = attrString.attributeMap .entrySet().iterator(); while (it.hasNext()) { java.util.MapNS.Entry <AttributedCharacterIteratorNS.Attribute, java.util.List <IAC_Range> > entry = it.next(); if (attributesAllowed == null || attributesAllowed.contains(entry.getKey())) { java.util.List <IAC_Range> ranges = entry.getValue(); if (inRange(ranges)) { result.add(entry.getKey()); } } } return(result); }