Added basic HTML generation and response handling.
[jrw.git] / src / jrw / sp / Name.java
diff --git a/src/jrw/sp/Name.java b/src/jrw/sp/Name.java
new file mode 100644 (file)
index 0000000..9029b7a
--- /dev/null
@@ -0,0 +1,33 @@
+package jrw.sp;
+
+public class Name {
+    public final Namespace ns;
+    public final String local;
+
+    public Name(Namespace ns, String local) {
+       if(local == null)
+           throw(new NullPointerException());
+       this.ns = ns;
+       this.local = local;
+    }
+
+    public Name(String local) {
+       this(null, local);
+    }
+
+    public int hashCode() {
+       return(System.identityHashCode(ns) + local.hashCode());
+    }
+
+    private boolean equals(Name that) {
+       return((this.ns == that.ns) && this.local.equals(that.local));
+    }
+
+    public boolean equals(Object x) {
+       return((x instanceof Name) && equals((Name)x));
+    }
+
+    public String toString() {
+       return((ns == null) ? local : (ns.prefabb + ":" + local));
+    }
+}