01: package com.etymon.pj.object;
02:
03: import java.util.*;
04:
05: /**
06: A representation of the PDF ProcSet type.
07: @author Nassib Nassar
08: */
09: public class PjProcSet extends PjArray {
10:
11: /**
12: Creates a ProcSet object.
13: */
14: public PjProcSet() {
15: super ();
16: }
17:
18: /**
19: Creates a ProcSet as a wrapper around a Vector.
20: @param v the Vector to use for this ProcSet.
21: */
22: public PjProcSet(Vector v) {
23: super (v);
24: }
25:
26: /**
27: Examines an array to see if it is a PDF ProcSet object.
28: @param array the array to examine.
29: @return true if the array could be interpreted as a
30: valid PjProcSet object.
31: */
32: public static boolean isLike(PjArray array) {
33: // see if all the names are legal ProcSet names
34: Enumeration m = array._v.elements();
35: PjName name;
36: Object obj;
37: while (m.hasMoreElements()) {
38: obj = m.nextElement();
39: if (!(obj instanceof PjName)) {
40: return false;
41: }
42: name = (PjName) obj;
43: if ((!name.equals(PjName.PDF))
44: && (!name.equals(PjName.TEXT))
45: && (!name.equals(PjName.IMAGEB))
46: && (!name.equals(PjName.IMAGEC))
47: && (!name.equals(PjName.IMAGEI))) {
48: return false;
49: }
50: }
51: return true;
52: }
53:
54: /**
55: Returns a deep copy of this object.
56: @return a deep copy of this object.
57: @exception CloneNotSupportedException if the instance can not be cloned.
58: */
59: public Object clone() throws CloneNotSupportedException {
60: return new PjProcSet(cloneVector());
61: }
62:
63: }
|