1 package com.etymon.pj.object; 2 3 import java.io.*; 4 5 9 public class PjBoolean 10 extends PjObject { 11 12 16 public PjBoolean(boolean b) { 17 _b = b; 18 } 19 20 24 public boolean getBoolean() { 25 return _b; 26 } 27 28 34 public long writePdf(OutputStream os) throws IOException { 35 if (_b) { 36 return write(os, "true"); 37 } else { 38 return write(os, "false"); 39 } 40 } 41 42 53 54 58 public Object clone() { 59 return this; 60 } 61 62 68 public boolean equals(Object obj) { 69 if (obj == null) { 70 return false; 71 } 72 if (obj instanceof PjBoolean) { 73 return (_b == ((PjBoolean)obj)._b); 74 } else { 75 return false; 76 } 77 } 78 79 public static final PjBoolean TRUE = new PjBoolean(true); 80 public static final PjBoolean FALSE = new PjBoolean(false); 81 82 private boolean _b; 83 84 } 85 | Popular Tags |