01: package com.etymon.pj.object.pagemark;
02:
03: import java.io.*;
04: import java.util.*;
05: import com.etymon.pj.object.*;
06:
07: /**
08: Color operator: SC.
09: @author Nassib Nassar
10: */
11: public class XXSC extends PageMarkOperator {
12:
13: public XXSC(PjNumber c1, PjNumber c2, PjNumber c3, PjNumber c4) {
14: _c1 = c1;
15: _c2 = c2;
16: _c3 = c3;
17: _c4 = c4;
18: _opcount = 4;
19: }
20:
21: public XXSC(PjNumber c1, PjNumber c2, PjNumber c3) {
22: _c1 = c1;
23: _c2 = c2;
24: _c3 = c3;
25: _opcount = 3;
26: }
27:
28: public PjNumber getC1() {
29: return _c1;
30: }
31:
32: public PjNumber getC2() {
33: return _c2;
34: }
35:
36: public PjNumber getC3() {
37: return _c3;
38: }
39:
40: public PjNumber getC4() {
41: if (_opcount == 4) {
42: return _c4;
43: } else {
44: return null;
45: }
46: }
47:
48: public long writePdf(OutputStream os) throws IOException {
49: long z = _c1.writePdf(os);
50: z = z + write(os, ' ');
51: z = z + _c2.writePdf(os);
52: z = z + write(os, ' ');
53: z = z + _c3.writePdf(os);
54: if (_opcount == 4) {
55: z = z + write(os, ' ');
56: z = z + _c4.writePdf(os);
57: }
58: z = z + writeln(os, " SC");
59: return z;
60: }
61:
62: /**
63: Returns a deep copy of this object.
64: @return a deep copy of this object.
65: */
66: public Object clone() {
67: return this ;
68: }
69:
70: public boolean equals(Object obj) {
71: if (obj == null) {
72: return false;
73: }
74: if (obj instanceof XXSC) {
75: if (_opcount == 4) {
76: return ((_opcount == ((XXSC) obj)._opcount)
77: && (_c1.equals(((XXSC) obj)._c1))
78: && (_c2.equals(((XXSC) obj)._c2))
79: && (_c3.equals(((XXSC) obj)._c3)) && (_c4
80: .equals(((XXSC) obj)._c4)));
81: } else {
82: return ((_opcount == ((XXSC) obj)._opcount)
83: && (_c1.equals(((XXSC) obj)._c1))
84: && (_c2.equals(((XXSC) obj)._c2)) && (_c4
85: .equals(((XXSC) obj)._c3)));
86: }
87: } else {
88: return false;
89: }
90: }
91:
92: private PjNumber _c1;
93: private PjNumber _c2;
94: private PjNumber _c3;
95: private PjNumber _c4;
96: private int _opcount;
97:
98: }
|