1 16 19 20 package org.apache.xalan.xsltc.compiler; 21 22 27 final class QName { 28 private final String _localname; 29 private String _prefix; 30 private String _namespace; 31 private String _stringRep; 32 private int _hashCode; 33 34 public QName(String namespace, String prefix, String localname) { 35 _namespace = namespace; 36 _prefix = prefix; 37 _localname = localname; 38 39 _stringRep = 40 (namespace != null && !namespace.equals(Constants.EMPTYSTRING)) ? 41 (namespace + ':' + localname) : localname; 42 43 _hashCode = _stringRep.hashCode() + 19; } 45 46 public void clearNamespace() { 47 _namespace = Constants.EMPTYSTRING; 48 } 49 50 public String toString() { 51 return _stringRep; 52 } 53 54 public String getStringRep() { 55 return _stringRep; 56 } 57 58 public boolean equals(Object other) { 59 return (this == other); 60 } 61 62 public String getLocalPart() { 63 return _localname; 64 } 65 66 public String getNamespace() { 67 return _namespace; 68 } 69 70 public String getPrefix() { 71 return _prefix; 72 } 73 74 public int hashCode() { 75 return _hashCode; 76 } 77 78 public String dump() { 79 return new String ("QName: " + _namespace + "(" + _prefix + "):" 80 + _localname); 81 } 82 } 83 | Popular Tags |