1 4 5 package com.etymon.pjx; 6 7 import java.io.*; 8 9 13 public class PdfNull 14 extends PdfObject { 15 16 19 public static final PdfNull NULL = new PdfNull(); 20 21 26 public PdfNull() { 27 } 28 29 45 public static boolean isNull(Object obj) { 46 47 return ( (obj == null) || (obj instanceof PdfNull) ); 48 49 } 50 51 public boolean equals(Object obj) { 52 53 if ( (obj == null) || ( !(obj instanceof PdfNull) ) ) { 54 return false; 55 } 56 57 return true; 58 } 59 60 public int hashCode() { 61 return 4321; 62 } 63 64 70 public static PdfNull valueOf() { 71 return PdfNull.NULL; 72 } 73 74 protected int writePdf(PdfWriter w, boolean spacing) throws IOException { 75 76 DataOutputStream dos = w.getDataOutputStream(); 77 78 int count; 79 80 if (spacing) { 81 dos.write(' '); 82 count = 1; 83 } else { 84 count = 0; 85 } 86 87 dos.writeBytes("null"); 88 return count + 4; 89 } 90 91 } 92 | Popular Tags |