[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./Makefile gzz/util/URN5Namespace.java
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./Makefile gzz/util/URN5Namespace.java |
Date: |
Sat, 19 Oct 2002 11:04:11 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/19 11:04:10
Modified files:
. : Makefile
gzz/util : URN5Namespace.java
Log message:
'make urn' now creates a new urn-5.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.195&tr2=1.196&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/util/URN5Namespace.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gzz/Makefile
diff -c gzz/Makefile:1.195 gzz/Makefile:1.196
*** gzz/Makefile:1.195 Mon Oct 14 04:17:12 2002
--- gzz/Makefile Sat Oct 19 11:04:10 2002
***************
*** 382,387 ****
--- 382,391 ----
GLLIB=LD_LIBRARY_PATH=/usr/lib:gfx
+ # Generate a single urn-5 identifier
+ urn:
+ $(JAVA) gzz.util.URN5Namespace
+
runjython:
$(GLLIB) $(JYTHON) $(DBG)
Index: gzz/gzz/util/URN5Namespace.java
diff -c gzz/gzz/util/URN5Namespace.java:1.1 gzz/gzz/util/URN5Namespace.java:1.2
*** gzz/gzz/util/URN5Namespace.java:1.1 Sat Oct 19 11:00:06 2002
--- gzz/gzz/util/URN5Namespace.java Sat Oct 19 11:04:10 2002
***************
*** 67,75 ****
--- 67,92 ----
}
}
+ /** Get the base id of the namespace.
+ * This does not generate unique identifiers: this is
+ * simply the prefix of all identifiers generated in this namespace.
+ * Of course, if you create a URN5Namespace, call this method once
+ * and then throw away the object, the result should be random.
+ */
+ synchronized public String getNamespaceId() {
+ return "urn:urn-5:" + namespace;
+ }
+
synchronized public String generateId() {
long num = nextNumber ++;
return "urn:urn-5:" + namespace + ":" + num;
+ }
+
+ /** If run as a main program, generate and print to
+ * stdout a single urn-5 identifier.
+ */
+ static public void main(String argv[]) {
+ System.out.println(new URN5Namespace().getNamespaceId());
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./Makefile gzz/util/URN5Namespace.java,
Tuomas J. Lukka <=