KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > etymon > pj > object > PjStreamDictionary


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 /**
9    A representation of a PDF stream dictionary. It is normally used
10    in constructing a PjStream object.
11    @author Nassib Nassar
12 */

13 public class PjStreamDictionary
14     extends PjDictionary {
15
16     /**
17        Creates a new stream dictionary.
18     */

19     public PjStreamDictionary() {
20         super();
21     }
22
23     /**
24        Creates a stream dictionary as a wrapper around an Hashtable.
25        @param h the Hashtable to use for this dictionary.
26     */

27     public PjStreamDictionary(Hashtable h) {
28         super(h);
29     }
30
31     public void setLength(PjNumber length) {
32         _h.put(PjName.LENGTH, length);
33     }
34
35     public void setLength(PjReference length) {
36         _h.put(PjName.LENGTH, length);
37     }
38
39     public PjObject getLength() throws InvalidPdfObjectException {
40         return hget(PjName.LENGTH);
41     }
42
43     public void setFilter(PjName filter) {
44         _h.put(PjName.FILTER, filter);
45     }
46
47     public void setFilter(PjArray filter) {
48         _h.put(PjName.FILTER, filter);
49     }
50
51     public void setFilter(PjReference filter) {
52         _h.put(PjName.FILTER, filter);
53     }
54
55     public PjObject getFilter() throws InvalidPdfObjectException {
56         return hget(PjName.FILTER);
57     }
58
59     public void setDecodeParms(PjObject decodeParms) {
60         _h.put(PjName.DECODEPARMS, decodeParms);
61     }
62
63     public PjObject getDecodeParms() throws InvalidPdfObjectException {
64         return hget(PjName.DECODEPARMS);
65     }
66
67     // we need something like this that takes a PjFileSpec instead of PjString
68
/*
69     public void setF(PjString f) {
70         _h.put(PjName.F, f);
71     }
72     */

73
74     public PjObject getF() throws InvalidPdfObjectException {
75         return hget(PjName.F);
76     }
77
78     public void setFFilter(PjName fFilter) {
79         _h.put(PjName.FFILTER, fFilter);
80     }
81
82     public void setFFilter(PjArray fFilter) {
83         _h.put(PjName.FFILTER, fFilter);
84     }
85
86     public void setFFilter(PjReference fFilter) {
87         _h.put(PjName.FFILTER, fFilter);
88     }
89
90     public PjObject getFFilter() throws InvalidPdfObjectException {
91         return hget(PjName.FFILTER);
92     }
93
94     public void setFDecodeParms(PjObject fDecodeParms) {
95         _h.put(PjName.FDECODEPARMS, fDecodeParms);
96     }
97
98     public PjObject getFDecodeParms() throws InvalidPdfObjectException {
99         return hget(PjName.FDECODEPARMS);
100     }
101
102     /**
103        Returns a deep copy of this object.
104        @return a deep copy of this object.
105        @exception CloneNotSupportedException if the instance can not be cloned.
106     */

107     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
108         return new PjStreamDictionary(cloneHt());
109     }
110     
111 }
112
Popular Tags