KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > etymon > pj > object > pagemark > XEI


1 package com.etymon.pj.object.pagemark;
2
3 import java.io.*;
4 import java.util.*;
5 import com.etymon.pj.object.*;
6
7 /**
8    Image operator: EI.
9    @author Nassib Nassar
10 */

11 public class XEI
12     extends PageMarkOperator {
13
14     public XEI(PjDictionary properties, byte[] imageData) {
15         _properties = properties;
16         _imageData = imageData;
17     }
18
19     public PjDictionary getProperties() {
20         return _properties;
21     }
22
23     public byte[] getImageData() {
24         return _imageData;
25     }
26
27     public long writePdf(OutputStream os) throws IOException {
28         long z = writeln(os, "BI");
29         z = z + _properties.writePdf(os);
30         z = z + write(os, "ID ");
31         z = z + write(os, _imageData);
32         z = z + writeln(os, "EI");
33         return z;
34     }
35     
36     /**
37        Returns a deep copy of this object.
38        @return a deep copy of this object.
39     */

40     public Object JavaDoc clone() {
41         // may need to be changed since we've added image data
42
return this;
43     }
44     
45     public boolean equals(Object JavaDoc obj) {
46         // may need to be changed since we've added image data
47
if (obj == null) {
48             return false;
49         }
50         if (obj instanceof XEI) {
51             return (_properties.equals(((XEI)obj)._properties));
52         } else {
53             return false;
54         }
55     }
56
57     private PjDictionary _properties;
58     private byte[] _imageData;
59     
60 }
61
Popular Tags