001: package com.etymon.pj.object;
002:
003: import java.io.*;
004: import java.util.*;
005: import com.etymon.pj.*;
006: import com.etymon.pj.exception.*;
007:
008: /**
009: A representation of a PDF stream dictionary. It is normally used
010: in constructing a PjStream object.
011: @author Nassib Nassar
012: */
013: public class PjStreamDictionary extends PjDictionary {
014:
015: /**
016: Creates a new stream dictionary.
017: */
018: public PjStreamDictionary() {
019: super ();
020: }
021:
022: /**
023: Creates a stream dictionary as a wrapper around an Hashtable.
024: @param h the Hashtable to use for this dictionary.
025: */
026: public PjStreamDictionary(Hashtable h) {
027: super (h);
028: }
029:
030: public void setLength(PjNumber length) {
031: _h.put(PjName.LENGTH, length);
032: }
033:
034: public void setLength(PjReference length) {
035: _h.put(PjName.LENGTH, length);
036: }
037:
038: public PjObject getLength() throws InvalidPdfObjectException {
039: return hget(PjName.LENGTH);
040: }
041:
042: public void setFilter(PjName filter) {
043: _h.put(PjName.FILTER, filter);
044: }
045:
046: public void setFilter(PjArray filter) {
047: _h.put(PjName.FILTER, filter);
048: }
049:
050: public void setFilter(PjReference filter) {
051: _h.put(PjName.FILTER, filter);
052: }
053:
054: public PjObject getFilter() throws InvalidPdfObjectException {
055: return hget(PjName.FILTER);
056: }
057:
058: public void setDecodeParms(PjObject decodeParms) {
059: _h.put(PjName.DECODEPARMS, decodeParms);
060: }
061:
062: public PjObject getDecodeParms() throws InvalidPdfObjectException {
063: return hget(PjName.DECODEPARMS);
064: }
065:
066: // we need something like this that takes a PjFileSpec instead of PjString
067: /*
068: public void setF(PjString f) {
069: _h.put(PjName.F, f);
070: }
071: */
072:
073: public PjObject getF() throws InvalidPdfObjectException {
074: return hget(PjName.F);
075: }
076:
077: public void setFFilter(PjName fFilter) {
078: _h.put(PjName.FFILTER, fFilter);
079: }
080:
081: public void setFFilter(PjArray fFilter) {
082: _h.put(PjName.FFILTER, fFilter);
083: }
084:
085: public void setFFilter(PjReference fFilter) {
086: _h.put(PjName.FFILTER, fFilter);
087: }
088:
089: public PjObject getFFilter() throws InvalidPdfObjectException {
090: return hget(PjName.FFILTER);
091: }
092:
093: public void setFDecodeParms(PjObject fDecodeParms) {
094: _h.put(PjName.FDECODEPARMS, fDecodeParms);
095: }
096:
097: public PjObject getFDecodeParms() throws InvalidPdfObjectException {
098: return hget(PjName.FDECODEPARMS);
099: }
100:
101: /**
102: Returns a deep copy of this object.
103: @return a deep copy of this object.
104: @exception CloneNotSupportedException if the instance can not be cloned.
105: */
106: public Object clone() throws CloneNotSupportedException {
107: return new PjStreamDictionary(cloneHt());
108: }
109:
110: }
|