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.bytes.IOutputStream;
30:
31: /**
32: Abstract PDF atomic object.
33: */
34: public abstract class PdfAtomicObject<TValue> extends PdfDirectObject {
35: // <class>
36: // <dynamic>
37: // <fields>
38: private TValue value;
39:
40: // </fields>
41:
42: // <constructors>
43: public PdfAtomicObject() {
44: }
45:
46: // </constructors>
47:
48: // <interface>
49: // <public>
50: public String toString() {
51: return value.toString();
52: }
53:
54: public TValue getValue() {
55: return value;
56: }
57:
58: public void setValue(TValue value) {
59: this .value = value;
60: }
61:
62: // </public>
63:
64: // <protected>
65: @Override
66: protected Object clone() {
67: return super .clone();
68: }
69:
70: // </protected>
71:
72: // <internal>
73: @Override
74: int writeTo(IOutputStream stream) {
75: return stream.write(toPdf());
76: }
77: // </internal>
78: // </interface>
79: // </dynamic>
80: // </class>
81: }
|