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 boolean object.
33: */
34: public class PdfBoolean extends PdfAtomicObject<Boolean> {
35: // <class>
36: // <static>
37: // <interface>
38: // <public>
39: public static String toPdf(boolean value) {
40: if (value)
41: return "true";
42: else
43: return "false";
44: }
45:
46: // </public>
47: // </interface>
48: // </static>
49:
50: // <dynamic>
51: // <constructors>
52: public PdfBoolean() {
53: }
54:
55: public PdfBoolean(boolean value) {
56: setValue(value);
57: }
58:
59: // </constructors>
60:
61: // <interface>
62: // <public>
63: @Override
64: public Object clone(File context) {
65: // Shallow copy.
66: PdfBoolean clone = (PdfBoolean) super .clone();
67:
68: // Deep copy.
69: /* NOTE: No mutable object to be cloned. */
70:
71: return clone;
72: }
73:
74: @Override
75: public String toPdf() {
76: return PdfBoolean.toPdf(getValue());
77: }
78: // </public>
79: // </interface>
80: // </dynamic>
81: // </class>
82: }
|