| 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 PjPages 13 extends PjPagesNode { 14 15 18 public PjPages() { 19 super(); 20 _h.put(PjName.TYPE, PjName.PAGES); 21 } 22 23 27 public PjPages(Hashtable h) { 28 super(h); 29 } 30 31 public void setKids(PjArray kids) { 32 _h.put(PjName.KIDS, kids); 33 } 34 35 public void setKids(PjReference kids) { 36 _h.put(PjName.KIDS, kids); 37 } 38 39 public PjObject getKids() throws InvalidPdfObjectException { 40 return hget(PjName.KIDS); 41 } 42 43 public void setCount(PjNumber count) { 44 _h.put(PjName.COUNT, count); 45 } 46 47 public void setCount(PjReference count) { 48 _h.put(PjName.COUNT, count); 49 } 50 51 public PjObject getCount() throws InvalidPdfObjectException { 52 return hget(PjName.COUNT); 53 } 54 55 61 public static boolean isLike(PjDictionary dictionary) { 62 Hashtable h = dictionary.getHashtable(); 63 try { 65 PjName type = (PjName)(h.get(PjName.TYPE)); 66 if (type == null) { 67 return false; 68 } 69 if ( ! type.equals(PjName.PAGES) ) { 70 return false; 71 } 72 } 73 catch (ClassCastException e) { 74 return false; 75 } 76 return true; 77 } 78 79 84 public Object clone() throws CloneNotSupportedException { 85 return new PjPages(cloneHt()); 86 } 87 88 } 89 | Popular Tags |