package org.eclipse.scanning.api.points.models;

public class GridModel implements IPathModelWithBoundingBox {
	
	private BoundingBox boundingBox;
	private int columns = 1;
	private int rows = 1;
	
	/** snake = true<br>
	  -------------------->  <br>
	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     | <br>
	  <--------------------  <br>
      |                             <br>
      --------------------> etc. <br>
      <br>
      snake = false<br>
 	  --------------------> <br>
	  --------------------> <br>
	  --------------------> <br>
	**/
	private boolean snake = false;
	
	private transient double xStep = 0.0;
	private transient double yStep = 0.0;
	
	public int getColumns() {
		return columns;
	}
	public void setColumns(int columns) {
		this.columns = columns;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		this.rows = rows;
	}
	
	/** snake = true<br>
	  -------------------->  <br>
	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     | <br>
	  <--------------------  <br>
    |                             <br>
    --------------------> etc. <br>
    <br>
    snake = false<br>
	  --------------------> <br>
	  --------------------> <br>
	  --------------------> <br>
	**/
	public boolean isSnake() {
		return snake;
	}
	public void setSnake(boolean biDirectional) {
		this.snake = biDirectional;
	}
	public double getxStep() {
		return xStep;
	}
	public void setxStep(double xStep) {
		this.xStep = xStep;
	}
	public double getyStep() {
		return yStep;
	}
	public void setyStep(double yStep) {
		this.yStep = yStep;
	}
	@Override
	public BoundingBox getBoundingBox() {
		return boundingBox;
	}
	@Override
	public void setBoundingBox(BoundingBox boundingBox) {
		this.boundingBox = boundingBox;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((boundingBox == null) ? 0 : boundingBox.hashCode());
		result = prime * result + columns;
		result = prime * result + rows;
		result = prime * result + (snake ? 1231 : 1237);
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		GridModel other = (GridModel) obj;
		if (boundingBox == null) {
			if (other.boundingBox != null)
				return false;
		} else if (!boundingBox.equals(other.boundingBox))
			return false;
		if (columns != other.columns)
			return false;
		if (rows != other.rows)
			return false;
		if (snake != other.snake)
			return false;
		return true;
	}
}

@@ -191,24 +191,38 @@
  = 1;%0A%09%0A%09/**
+%0A%09 * %3Cpre%3E%0A%09 *
  snake = tru
@@ -214,39 +214,36 @@
 %09 * snake = true
-%3Cbr%3E
 %0A%09 
+*
  ---------------
@@ -252,212 +252,38 @@
 ---%3E
-  %3Cbr%3E%0A%09  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+%0A%09 *                
      %7C
- %3Cbr%3E
 %0A%09 
+*
  %3C--
@@ -304,61 +304,18 @@
 ----
-  %3Cbr%3E%0A      %7C                             %3Cbr%3E%0A     
+%0A%09 * %7C%0A%09 *
  ---
@@ -341,30 +341,23 @@
 etc.
- %3Cbr%3E
 %0A     
+*
  
-%3Cbr%3E
 %0A     
+*
  sna
@@ -370,16 +370,15 @@
 alse
-%3Cbr%3E%0A %09 
+%0A     *
  ---
@@ -391,32 +391,31 @@
 -----------%3E
- %3Cbr%3E%0A%09 
+%0A     *
  -----------
@@ -420,32 +420,31 @@
 -----------%3E
- %3Cbr%3E%0A%09 
+%0A     *
  -----------
@@ -445,36 +445,45 @@
 ---------------%3E
- %3Cbr
+%0A     * %3C/pre
 %3E%0A%09**/%0A%09private 
@@ -807,16 +807,30 @@
 %7D%0A%09%0A%09/**
+%0A%09 * %3Cpre%3E%0A%09 *
  snake =
@@ -834,23 +834,20 @@
 e = true
-%3Cbr%3E
 %0A%09 
+*
  -------
@@ -864,212 +864,38 @@
 ---%3E
-  %3Cbr%3E%0A%09  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+%0A%09 *                
      %7C
- %3Cbr%3E
 %0A%09 
+*
  %3C--
@@ -916,57 +916,18 @@
 ----
-  %3Cbr%3E%0A    %7C                             %3Cbr%3E%0A   
+%0A%09 * %7C%0A%09 *
  ---
@@ -953,26 +953,23 @@
 etc.
- %3Cbr%3E
 %0A    
-%3Cbr%3E
+ * 
 %0A   
+  *
  sna
@@ -978,23 +978,23 @@
  = false
-%3Cbr%3E%0A%09 
+%0A     *
  -------
@@ -1003,32 +1003,31 @@
 -----------%3E
- %3Cbr%3E%0A%09 
+%0A     *
  -----------
@@ -1040,16 +1040,15 @@
 ---%3E
- %3Cbr%3E%0A%09 
+%0A     *
  ---
@@ -1069,12 +1069,21 @@
 ---%3E
- %3Cbr
+%0A     * %3C/pre
 %3E%0A%09*

Improve Javadoc formatting