View Javadoc
1   package com.github.celldynamics.quimp.plugin.randomwalk;
2   
3   /**
4    * Basic class for storing point in Cartesian system.
5    * 
6    * @author p.baniukiewicz
7    *
8    */
9   public class Point {
10  
11    /**
12     * Column.
13     */
14    int col;
15    /**
16     * Row.
17     */
18    int row;
19  
20    /**
21     * Declare point.
22     *
23     * @param col col
24     * @param row row
25     */
26    public Point(int col, int row) {
27      this.row = row;
28      this.col = col;
29    }
30  
31    /**
32     * Default constructor. Declares Point(0,0)
33     */
34    Point() {
35      row = 0;
36      col = 0;
37    }
38  
39    /*
40     * (non-Javadoc)
41     * 
42     * @see java.lang.Object#hashCode()
43     */
44    @Override
45    public int hashCode() {
46      final int prime = 31;
47      int result = 1;
48      result = prime * result + col;
49      result = prime * result + row;
50      return result;
51    }
52  
53    /*
54     * (non-Javadoc)
55     * 
56     * @see java.lang.Object#equals(java.lang.Object)
57     */
58    @Override
59    public boolean equals(Object obj) {
60      if (this == obj) {
61        return true;
62      }
63      if (obj == null) {
64        return false;
65      }
66      if (getClass() != obj.getClass()) {
67        return false;
68      }
69      Point="../../../../../../com/github/celldynamics/quimp/plugin/randomwalk/Point.html#Point">Point other = (Point) obj;
70      if (col != other.col) {
71        return false;
72      }
73      if (row != other.row) {
74        return false;
75      }
76      return true;
77    }
78  
79    /*
80     * (non-Javadoc)
81     * 
82     * @see java.lang.Object#toString()
83     */
84    @Override
85    public String toString() {
86      return "Point [row=" + row + ", col=" + col + "]";
87    }
88  
89  }