KickJava   Java API By Example, From Geeks To Geeks.

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


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    Path operator: y.
9    @author Nassib Nassar
10 */

11 public class Xy
12     extends PageMarkOperator {
13
14     public Xy(PjNumber x1, PjNumber y1, PjNumber x3, PjNumber y3) {
15         _x1 = x1;
16         _y1 = y1;
17         _x3 = x3;
18         _y3 = y3;
19     }
20
21     public PjNumber getX1() {
22         return _x1;
23     }
24
25     public PjNumber getY1() {
26         return _y1;
27     }
28
29     public PjNumber getX3() {
30         return _x3;
31     }
32
33     public PjNumber getY3() {
34         return _y3;
35     }
36
37     public long writePdf(OutputStream os) throws IOException {
38         long z = _x1.writePdf(os);
39         z = z + write(os, ' ');
40         z = z + _y1.writePdf(os);
41         z = z + write(os, ' ');
42         z = z + _x3.writePdf(os);
43         z = z + write(os, ' ');
44         z = z + _y3.writePdf(os);
45         z = z + writeln(os, " y");
46         return z;
47     }
48     
49     /**
50        Returns a deep copy of this object.
51        @return a deep copy of this object.
52     */

53     public Object JavaDoc clone() {
54         return this;
55     }
56     
57     public boolean equals(Object JavaDoc obj) {
58         if (obj == null) {
59             return false;
60         }
61         if (obj instanceof Xy) {
62             return ( (_x1.equals(((Xy)obj)._x1)) &&
63                  (_y1.equals(((Xy)obj)._y1)) &&
64                  (_x3.equals(((Xy)obj)._x3)) &&
65                  (_y3.equals(((Xy)obj)._y3)) );
66         } else {
67             return false;
68         }
69     }
70
71     private PjNumber _x1;
72     private PjNumber _y1;
73     private PjNumber _x3;
74     private PjNumber _y3;
75     
76 }
77
Popular Tags