1 23 24 package org.apache.slide.common; 25 26 34 public final class Scope { 35 36 public static final Scope ROOT = new Scope("/"); 37 38 40 41 46 public Scope(String scope) { 47 this.scope = scope; 48 scopeID = scope.hashCode(); 49 } 50 51 52 54 55 58 private int scopeID; 59 60 61 64 private String scope; 65 66 67 69 70 75 public String toString() { 76 return this.scope; 77 } 78 79 80 86 public boolean equals(Object obj) { 87 boolean result = false; 88 if ((obj != null) && (obj instanceof Scope)) { 89 Scope scope = (Scope) obj; 90 result = (this.scopeID == scope.hashCode()); 91 } 92 return result; 93 } 94 95 96 102 public int hashCode() { 103 return this.scopeID; 104 } 105 106 } 107 | Popular Tags |