01: package com.etymon.pj.object;
02:
03: import java.io.*;
04:
05: /**
06: A representation of the PDF null type.
07: @author Nassib Nassar
08: */
09: public class PjNull extends PjObject {
10:
11: /**
12: Creates a null object.
13: */
14: public PjNull() {
15: }
16:
17: /**
18: Writes this object (null) to a stream in PDF format.
19: @param os the stream to write to.
20: @return the number of bytes written.
21: @exception IOException if an I/O error occurs.
22: */
23: public long writePdf(OutputStream os) throws IOException {
24: return write(os, "null");
25: }
26:
27: /**
28: Returns a string representation of this null object in PDF format.
29: @return the string representation.
30: public String toString() {
31: return "null";
32: }
33: */
34:
35: /**
36: Returns a deep copy of this object.
37: @return a deep copy of this object.
38: */
39: public Object clone() {
40: return this ;
41: }
42:
43: /**
44: Compares two PjNull objects for equality. They are
45: automatically considered to be equal if both objects are
46: truly instances of PjNull.
47: @param obj the reference object to compare to.
48: @return true if this object is the same as obj, false
49: otherwise.
50: */
51: public boolean equals(Object obj) {
52: if (obj == null) {
53: return false;
54: }
55: return (obj instanceof PjNull);
56: }
57:
58: }
|