View Javadoc
1   package au.gov.amsa.geo.distance;
2   
3   import au.gov.amsa.geo.model.Cell;
4   import au.gov.amsa.geo.model.Options;
5   
6   public class CellAndDistance {
7   	private final Cell cell;
8   	private final double distanceNm;
9   
10  	public CellAndDistance(Cell cell, double distanceNm) {
11  		this.cell = cell;
12  		this.distanceNm = distanceNm;
13  	}
14  
15  	public Cell getCell() {
16  		return cell;
17  	}
18  
19  	public double getDistanceNm() {
20  		return distanceNm;
21  	}
22  
23  	/**
24  	 * Returns traffic density value for the cell in nm per square nm.
25  	 * 
26  	 * @param options
27  	 * @return
28  	 */
29  	public double getTrafficDensity(Options options) {
30  		return distanceNm / cell.areaNauticalMiles(options);
31  	}
32  
33  	@Override
34  	public String toString() {
35  		return "CellAndDistance [cell=" + cell + ", distanceNm=" + distanceNm
36  				+ "]";
37  	}
38  
39  }