1 23 package org.enhydra.kelp.common.dods; 24 25 26 import java.io.Serializable ; 27 28 public class XYConstraints 29 implements Cloneable , Serializable 30 { 31 32 int x; 33 int y; 34 int width; 35 int height; 36 37 public XYConstraints() 38 { 39 this(0, 0, 0, 0); 40 } 41 42 public XYConstraints(int x, int y, int width, int height) 43 { 44 this.x = x; 45 this.y = y; 46 this.width = width; 47 this.height = height; 48 } 49 50 public int getX() 51 { 52 return x; 53 } 54 55 public void setX(int x) 56 { 57 this.x = x; 58 } 59 60 public int getY() 61 { 62 return y; 63 } 64 65 public void setY(int y) 66 { 67 this.y = y; 68 } 69 70 public int getWidth() 71 { 72 return width; 73 } 74 75 public void setWidth(int width) 76 { 77 this.width = width; 78 } 79 80 public int getHeight() 81 { 82 return height; 83 } 84 85 public void setHeight(int height) 86 { 87 this.height = height; 88 } 89 90 public int hashCode() 91 { 92 return x ^ y * 37 ^ width * 43 ^ height * 47; 93 } 94 95 public boolean equals(Object that) 96 { 97 if(that instanceof XYConstraints) 98 { 99 XYConstraints other = (XYConstraints)that; 100 return other.x == x && other.y == y && other.width == width && other.height == height; 101 } else 102 { 103 return false; 104 } 105 } 106 107 public Object clone() 108 { 109 return new XYConstraints(x, y, width, height); 110 } 111 112 public String toString() 113 { 114 return String.valueOf(String.valueOf((new StringBuffer ("XYConstraints[")).append(x).append(",").append(y).append(",").append(width).append(",").append(height).append("]"))); 115 } 116 } 117 | Popular Tags |