1 21 package proguard; 22 23 import java.util.*; 24 25 31 public class KeepSpecification extends ClassSpecification 32 { 33 public boolean markClasses; 34 public boolean markConditionally; 35 public boolean allowShrinking; 36 public boolean allowOptimization; 37 public boolean allowObfuscation; 38 39 40 53 public KeepSpecification(boolean markClasses, 54 boolean markConditionally, 55 boolean allowShrinking, 56 boolean allowOptimization, 57 boolean allowObfuscation) 58 { 59 this.markClasses = markClasses; 60 this.markConditionally = markConditionally; 61 this.allowShrinking = allowShrinking; 62 this.allowOptimization = allowOptimization; 63 this.allowObfuscation = allowObfuscation; 64 } 65 66 67 81 public KeepSpecification(boolean markClasses, 82 boolean markConditionally, 83 boolean allowShrinking, 84 boolean allowOptimization, 85 boolean allowObfuscation, 86 ClassSpecification classSpecification) 87 { 88 super(classSpecification); 89 90 this.markClasses = markClasses; 91 this.markConditionally = markConditionally; 92 this.allowShrinking = allowShrinking; 93 this.allowOptimization = allowOptimization; 94 this.allowObfuscation = allowObfuscation; 95 } 96 97 98 100 public boolean equals(Object object) 101 { 102 if (object == null || 103 this.getClass() != object.getClass()) 104 { 105 return false; 106 } 107 108 KeepSpecification other = (KeepSpecification)object; 109 return 110 this.markClasses == other.markClasses && 111 this.markConditionally == other.markConditionally && 112 this.allowShrinking == other.allowShrinking && 113 this.allowOptimization == other.allowOptimization && 114 this.allowObfuscation == other.allowObfuscation && 115 super.equals(other); 116 } 117 118 public int hashCode() 119 { 120 return 121 (markClasses ? 0 : 1) ^ 122 (markConditionally ? 0 : 2) ^ 123 (allowShrinking ? 0 : 4) ^ 124 (allowOptimization ? 0 : 8) ^ 125 (allowObfuscation ? 0 : 16) ^ 126 super.hashCode(); 127 } 128 129 public Object clone() 130 { 131 return super.clone(); 134 } 140 } 141 | Popular Tags |