KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.etymon.pj.object;
2
3 import java.util.*;
4
5 /**
6    A representation of the PDF ProcSet type.
7    @author Nassib Nassar
8 */

9 public class PjProcSet
10     extends PjArray {
11
12     /**
13        Creates a ProcSet object.
14     */

15     public PjProcSet() {
16         super();
17     }
18
19     /**
20        Creates a ProcSet as a wrapper around a Vector.
21        @param v the Vector to use for this ProcSet.
22     */

23     public PjProcSet(Vector v) {
24         super(v);
25     }
26
27     /**
28            Examines an array to see if it is a PDF ProcSet object.
29            @param array the array to examine.
30            @return true if the array could be interpreted as a
31            valid PjProcSet object.
32         */

33         public static boolean isLike(PjArray array) {
34         // see if all the names are legal ProcSet names
35
Enumeration m = array._v.elements();
36         PjName name;
37         Object JavaDoc obj;
38         while (m.hasMoreElements()) {
39             obj = m.nextElement();
40             if ( ! (obj instanceof PjName) ) {
41                 return false;
42             }
43             name = (PjName)obj;
44             if ( ( ! name.equals(PjName.PDF) ) &&
45                  ( ! name.equals(PjName.TEXT) ) &&
46                  ( ! name.equals(PjName.IMAGEB) ) &&
47                  ( ! name.equals(PjName.IMAGEC) ) &&
48                  ( ! name.equals(PjName.IMAGEI) ) ) {
49                 return false;
50             }
51         }
52         return true;
53         }
54
55     /**
56        Returns a deep copy of this object.
57        @return a deep copy of this object.
58        @exception CloneNotSupportedException if the instance can not be cloned.
59     */

60     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
61         return new PjProcSet(cloneVector());
62     }
63
64 }
65
Popular Tags