1 4 5 package com.etymon.pjx; 6 7 import java.io.*; 8 9 14 public class PdfLong 15 extends PdfNumber { 16 17 20 protected long _n; 21 22 27 public PdfLong(long n) { 28 _n = n; 29 } 30 31 public boolean equals(Object obj) { 32 33 if ( (obj == null) || ( !(obj instanceof PdfLong) ) ) { 34 return false; 35 } 36 37 return (_n == ((PdfLong)obj)._n); 38 } 39 40 public int getInt() { 41 return (int)_n; 42 } 43 44 public long getLong() { 45 return _n; 46 } 47 48 public float getFloat() { 49 return (float)_n; 50 } 51 52 public int hashCode() { 53 return (int)( _n ^ ( _n >>> 32 ) ); 54 } 55 56 protected int writePdf(PdfWriter w, boolean spacing) throws IOException { 57 58 DataOutputStream dos = w.getDataOutputStream(); 59 60 int count; 61 62 if (spacing) { 63 dos.write(' '); 64 count = 1; 65 } else { 66 count = 0; 67 } 68 69 String s = Long.toString(_n); 70 dos.writeBytes(s); 71 return count + s.length(); 72 73 } 74 75 } 76 | Popular Tags |