?? qname.java
字號:
package edu.stanford.db.xml.util;public class QName { String namespace; String localName; public QName(String ns, String ln) { namespace = ns; localName = ln; } public QName(String ln) { namespace = null; localName = ln; } public int hashCode() { return getName().hashCode(); } public String getName() { return namespace == null ? localName : namespace + localName; } public String toString() { return getName(); } public String getNamespace() { return namespace; } public String getLocalName() { return localName; } public boolean equals (Object that) { if (this == that) { return true; } if (that == null) { return false; } if(that instanceof QName) { QName t = (QName)that; // resources are equal iff this.getURI() == that.getURI() // the case distinction below is for optimization only to avoid unnecessary string concatenation boolean b; if(namespace == null) { if(t.getNamespace() == null) b = localName.equals(t.getLocalName()); else // maybe "that" did not detect names b = localName.equals(t.getName()); } else { if(t.getNamespace() != null) b = localName.equals(t.getLocalName()) && namespace.equals(t.getNamespace()); else // maybe "this" did not detect names b = getName().equals(t.getName()); } return b; } else return getName().equals(String.valueOf(that)); } }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -