-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.java
53 lines (47 loc) · 1.56 KB
/
Node.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
public class Node {
private int x, y ; // index of this node in the array
private double exps ; // exposure
int index ; // index of node after sorting
public int getX() { return x; }
public int getY() { return y; }
public double getExposure() { return exps; }
public int getIndex(){return index;}
public void setX(int x) { this.x = x; }
public void setY(int y) { this.y = y; }
public void setExposure(double exps) { this.exps = exps; }
public void setIndex(int index){this.index = index ;}
public void setIndex(){index = 0;}
public Node(int x, int y, double exps){
setX(x);
setY(y);
setExposure(exps);
setIndex();
}
public boolean checkTop(int top){
if (y== top)
return true ;
else
return false;
}
public boolean checkBottom( int bottom){
return checkTop(bottom);
}
// public boolean checkRight(Node other){
// return ( ((x+1)== other.getX())&&( y == other.getY()));
// }
// public boolean checkLeft(Node other){
// return other.checkRight(this);
// }
// public boolean checkAbove(Node other){
// return ((x== other.getX())&&((y+1)==other.getY()));
// }
// public boolean checkBelow(Node other){
// return other.checkAbove(this) ;
// }
// public boolean checkNeighbor(Node other){
// return ( (checkRight(other)) || (checkLeft(other)) || (checkAbove(other)) || (checkBelow(other))) ;
// }
public void printCoor(){
System.out.print("( "+ x +", "+ y+") ");
}
}