1 17 18 19 20 package org.apache.fop.svg; 21 22 import java.text.AttributedCharacterIterator ; 23 import java.text.CharacterIterator ; 24 import java.util.Iterator ; 25 import java.util.Map ; 26 27 30 public final class ACIUtils { 31 32 private ACIUtils() { 33 } 35 36 40 public static void dumpAttrs(AttributedCharacterIterator aci) { 41 aci.first(); 42 Iterator i = aci.getAttributes().entrySet().iterator(); 43 while (i.hasNext()) { 44 Map.Entry entry = (Map.Entry )i.next(); 45 if (entry.getValue() != null) { 46 System.out.println(entry.getKey() + ": " + entry.getValue()); 47 } 48 } 49 int start = aci.getBeginIndex(); 50 System.out.print("AttrRuns: "); 51 while (aci.current() != CharacterIterator.DONE) { 52 int end = aci.getRunLimit(); 53 System.out.print("" + (end - start) + ", "); 54 aci.setIndex(end); 55 if (start == end) { 56 break; 57 } 58 start = end; 59 } 60 System.out.println(""); 61 } 62 63 } 64 | Popular Tags |