KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > etymon > pj > object > PjNull


1 package com.etymon.pj.object;
2
3 import java.io.*;
4
5 /**
6    A representation of the PDF null type.
7    @author Nassib Nassar
8 */

9 public class PjNull
10     extends PjObject {
11
12     /**
13        Creates a null object.
14     */

15     public PjNull() {
16     }
17
18         /**
19            Writes this object (null) to a stream in PDF format.
20            @param os the stream to write to.
21            @return the number of bytes written.
22            @exception IOException if an I/O error occurs.
23          */

24         public long writePdf(OutputStream os) throws IOException {
25                 return write(os, "null");
26         }
27
28     /**
29        Returns a string representation of this null object in PDF format.
30        @return the string representation.
31     public String toString() {
32         return "null";
33     }
34      */

35
36     /**
37        Returns a deep copy of this object.
38        @return a deep copy of this object.
39     */

40     public Object JavaDoc clone() {
41         return this;
42     }
43     
44     /**
45        Compares two PjNull objects for equality. They are
46        automatically considered to be equal if both objects are
47        truly instances of PjNull.
48        @param obj the reference object to compare to.
49        @return true if this object is the same as obj, false
50        otherwise.
51     */

52     public boolean equals(Object JavaDoc obj) {
53         if (obj == null) {
54             return false;
55         }
56         return (obj instanceof PjNull);
57     }
58     
59 }
60
Popular Tags