1 21 package proguard.obfuscate; 22 23 import java.io.*; 24 import java.util.*; 25 26 32 public class SpecialNameFactory implements NameFactory 33 { 34 private static final char SPECIAL_SUFFIX = '_'; 35 36 37 private final NameFactory nameFactory; 38 39 40 45 public SpecialNameFactory(NameFactory nameFactory) 46 { 47 this.nameFactory = nameFactory; 48 } 49 50 51 53 public void reset() 54 { 55 nameFactory.reset(); 56 } 57 58 59 public String nextName() 60 { 61 return nameFactory.nextName() + SPECIAL_SUFFIX; 62 } 63 64 65 67 70 static boolean isSpecialName(String name) 71 { 72 return name != null && 73 name.charAt(name.length()-1) == SPECIAL_SUFFIX; 74 } 75 76 77 public static void main(String [] args) 78 { 79 SpecialNameFactory factory = new SpecialNameFactory(new SimpleNameFactory()); 80 81 for (int counter = 0; counter < 50; counter++) 82 { 83 System.out.println("["+factory.nextName()+"]"); 84 } 85 } 86 } 87 | Popular Tags |