1: package com.sunzhenxing;
2:
3: public class Point {
4: private int x;
5: private int y;
6: private boolean isKey;
7: private boolean isClassed;
8:
9: public boolean isKey() {
10: return isKey;
11: }
12: public void setKey(boolean isKey) {
13: this.isKey = isKey;
14: this.isClassed=true;
15: }
16: public boolean isClassed() {
17: return isClassed;
18: }
19: public void setClassed(boolean isClassed) {
20: this.isClassed = isClassed;
21: }
22: public int getX() {
23: return x;
24: }
25: public void setX(int x) {
26: this.x = x;
27: }
28: public int getY() {
29: return y;
30: }
31: public void setY(int y) {
32: this.y = y;
33: }
34:
35: public Point(){
36: x=0;
37: y=0;
38: }
39: public Point(int x,int y){
40: this.x=x;
41: this.y=y;
42: }
43: public Point(String str){
44: String[] p=str.split(",");
45: this.x=Integer.parseInt(p[0]);
46: this.y=Integer.parseInt(p[1]);
47: }
48: public String print(){
49: return "<"+this.x+","+this.y+">";
50: }
51: }
52: