| 1 package com.etymon.pj.object; 2 3 import java.io.*; 4 import java.util.*; 5 import com.etymon.pj.*; 6 import com.etymon.pj.exception.*; 7 8 12 public class PjEncoding 13 extends PjDictionary { 14 15 18 public PjEncoding() { 19 super(); 20 _h.put(PjName.TYPE, PjName.ENCODING); 21 } 22 23 27 public PjEncoding(Hashtable h) { 28 super(h); 29 } 30 31 public void setBaseEncoding(PjName baseEncoding) { 32 _h.put(PjName.BASEENCODING, baseEncoding); 33 } 34 35 public void setBaseEncoding(PjReference baseEncoding) { 36 _h.put(PjName.BASEENCODING, baseEncoding); 37 } 38 39 public PjObject getBaseEncoding() throws InvalidPdfObjectException { 40 return hget(PjName.BASEENCODING); 41 } 42 43 public void setDifferences(PjArray differences) { 44 _h.put(PjName.DIFFERENCES, differences); 45 } 46 47 public void setDifferences(PjReference differences) { 48 _h.put(PjName.DIFFERENCES, differences); 49 } 50 51 public PjObject getDifferences() throws InvalidPdfObjectException { 52 return hget(PjName.DIFFERENCES); 53 } 54 55 62 public static boolean isLike(PjDictionary dictionary) { 63 Hashtable h = dictionary.getHashtable(); 64 try { 66 PjName type = (PjName)(h.get(PjName.TYPE)); 67 if (type == null) { 68 return false; 69 } 70 if ( ! type.equals(PjName.ENCODING) ) { 71 return false; 72 } 73 } 74 catch (ClassCastException e) { 75 return false; 76 } 77 return true; 78 } 79 80 85 public Object clone() throws CloneNotSupportedException { 86 return new PjEncoding(cloneHt()); 87 } 88 89 } 90 | Popular Tags |