01: package gnu.kawa.xml;
02:
03: /** A loosely typed string.
04: * Can be cast as needed to numbers and other types.
05: * Implements the {@code xs:untypedAtomic} type of XPath/XQuery, which use
06: * it to represent attribute and text values of unvalidated XML.
07: */
08:
09: public class UntypedAtomic {
10: String text;
11:
12: public String toString() {
13: return text;
14: }
15:
16: public UntypedAtomic(String text) {
17: this .text = text;
18: }
19:
20: public int hashCode() {
21: return text.hashCode();
22: }
23:
24: public boolean equals(Object arg) {
25: return arg instanceof UntypedAtomic
26: && text.equals(((UntypedAtomic) arg).text);
27: }
28: }
|