1 19 20 package soot; 21 import soot.util.*; 22 23 26 public final class Kind implements Numberable 27 { 28 public static final Kind INVALID = new Kind( "INVALID" ); 29 30 public static final Kind STATIC = new Kind( "STATIC" ); 31 32 public static final Kind VIRTUAL = new Kind( "VIRTUAL" ); 33 34 public static final Kind INTERFACE = new Kind( "INTERFACE" ); 35 36 public static final Kind SPECIAL = new Kind( "SPECIAL" ); 37 38 public static final Kind CLINIT = new Kind( "CLINIT" ); 39 40 public static final Kind THREAD = new Kind( "THREAD" ); 41 42 public static final Kind FINALIZE = new Kind( "FINALIZE" ); 43 44 public static final Kind INVOKE_FINALIZE = new Kind( "INVOKE_FINALIZE" ); 45 46 public static final Kind PRIVILEGED = new Kind( "PRIVILEGED" ); 47 48 public static final Kind NEWINSTANCE = new Kind( "NEWINSTANCE" ); 49 50 private Kind( String name ) { 51 this.name = name; 52 } 53 private final String name; 54 private int num; 55 56 public String name() { return name; } 57 public int getNumber() { return num; } 58 public void setNumber( int num ) { this.num = num; } 59 60 public String toString() { return name(); } 61 62 public boolean passesParameters() { 63 return isExplicit() || this == THREAD || this == FINALIZE || 64 this == PRIVILEGED || this == NEWINSTANCE || this == INVOKE_FINALIZE; 65 } 66 67 68 public boolean isExplicit() { 69 return isInstance() || isStatic(); 70 } 71 72 74 public boolean isInstance() { 75 return this == VIRTUAL || this == INTERFACE || this == SPECIAL; 76 } 77 78 79 public boolean isClinit() { 80 return this == CLINIT; 81 } 82 84 public boolean isStatic() { 85 return this == STATIC; 86 } 87 88 } 89 90 | Popular Tags |