KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > stefanochizzolini > clown > objects > PdfLong


1 /*
2   Copyright 2006 Stefano Chizzolini. http://clown.stefanochizzolini.it
3
4   Contributors:
5     * Stefano Chizzolini (original code developer, info@stefanochizzolini.it):
6       contributed code is Copyright 2006 by Stefano Chizzolini.
7
8   This file should be part of the source code distribution of "PDF Clown library"
9   (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 long integer number object.
33 */

34 public class PdfLong
35   extends PdfAtomicObject<Long JavaDoc>
36   implements IPdfNumber
37 {
38   // <class>
39
// <static>
40
// <interface>
41
public static String JavaDoc toPdf(
42     long value
43     )
44   {
45     return Long.toString(value);
46   }
47   // </interface>
48
// </static>
49

50   // <dynamic>
51
// <constructors>
52
public PdfLong(
53     long value
54     )
55   {
56     setValue(value);
57   }
58   // </constructors>
59

60   // <interface>
61
// <public>
62
@Override JavaDoc
63   public Object JavaDoc clone(
64     File context
65     )
66   {
67     // Shallow copy.
68
PdfLong clone = (PdfLong)super.clone();
69
70     // Deep copy.
71
/* NOTE: No mutable object to be cloned. */
72
73     return clone;
74   }
75
76   @Override JavaDoc
77   public String JavaDoc toPdf(
78     )
79   {
80     return PdfLong.toPdf(getValue());
81   }
82
83   // <IPdfNumber>
84
public double getNumberValue(
85     )
86   {return getValue();}
87
88   public void setNumberValue(
89     double value
90     )
91   {setValue((long)value);}
92
93   public void translateNumberValue(
94     double value
95     )
96   {setValue(getValue()+(long)value);}
97   // </IPdfNumber>
98
// </public>
99
// </interface>
100
// </dynamic>
101
// </class>
102
}
Popular Tags