1 7 package com.ibm.icu.text; 8 9 10 14 class RemoveTransliterator extends Transliterator { 15 16 19 private static String _ID = "Any-Remove"; 20 21 24 static void register() { 25 Transliterator.registerFactory(_ID, new Transliterator.Factory() { 26 public Transliterator getInstance(String ID) { 27 return new RemoveTransliterator(); 28 } 29 }); 30 Transliterator.registerSpecialInverse("Remove", "Null", false); 31 } 32 33 36 public RemoveTransliterator() { 37 super(_ID, null); 38 } 39 40 43 protected void handleTransliterate(Replaceable text, 44 Position index, boolean incremental) { 45 text.replace(index.start, index.limit, ""); 48 int len = index.limit - index.start; 49 index.contextLimit -= len; 50 index.limit -= len; 51 } 52 } 53 | Popular Tags |