01: /*
02: Copyright © 2006 Stefano Chizzolini. http://clown.stefanochizzolini.it
03:
04: Contributors:
05: * Stefano Chizzolini (original code developer, http://www.stefanochizzolini.it):
06: contributed code is Copyright © 2006 by Stefano Chizzolini.
07:
08: This file should be part of the source code distribution of "PDF Clown library"
09: (the Program): see the accompanying README files for more info.
10:
11: This Program is free software; you can redistribute it and/or modify it under
12: the terms of the GNU General Public License as published by the Free Software
13: Foundation; either version 2 of the License, or (at your option) any later version.
14:
15: This Program is distributed in the hope that it will be useful, but WITHOUT ANY
16: WARRANTY, either expressed or implied; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
18:
19: You should have received a copy of the GNU General Public License along with this
20: Program (see README files); if not, go to the GNU website (http://www.gnu.org/).
21:
22: Redistribution and use, with or without modification, are permitted provided that such
23: redistributions retain the above copyright notice, license and disclaimer, along with
24: this list of conditions.
25: */
26:
27: package it.stefanochizzolini.clown.objects;
28:
29: import it.stefanochizzolini.clown.files.File;
30:
31: /**
32: PDF hexadecimal string.
33: */
34: public class PdfHex extends PdfAtomicObject<String> implements
35: IPdfString {
36: // <class>
37: // <static>
38: // <interface>
39: // <public>
40: public static String toPdf(String value) {
41: return "<" + value + ">";
42: }
43:
44: // </public>
45: // </interface>
46: // </static>
47:
48: // <dynamic>
49: // <constructors>
50: public PdfHex() {
51: }
52:
53: public PdfHex(String value) {
54: setValue(value);
55: }
56:
57: // </constructors>
58:
59: // <interface>
60: // <public>
61: @Override
62: public Object clone(File context) {
63: // Shallow copy.
64: PdfHex clone = (PdfHex) super .clone();
65:
66: // Deep copy.
67: /* NOTE: No mutable object to be cloned. */
68:
69: return clone;
70: }
71:
72: @Override
73: public String toPdf() {
74: return PdfHex.toPdf(getValue());
75: }
76:
77: // <IPdfString>
78: public String getStringValue() {
79: return getValue();
80: }
81:
82: public void setStringValue(String value) {
83: setValue(value);
84: }
85: // </IPdfString>
86: // </public>
87: // </interface>
88: // </dynamic>
89: // </class>
90: }
|