root/tools/routingservice/trunk/src/jp/co/orkney/restlet/util/Limit.java

Revision 170, 1.0 KB (checked in by anton, 3 years ago)

Extent limitation added

Line 
1package jp.co.orkney.restlet.util;
2
3import java.math.BigDecimal;
4
5public class Limit
6{
7    static final double UPPER_BOUND = 1000000;
8    static final double LOWER_BOUND = -1000000;
9   
10    private double distance;
11    private Extent extent;
12
13    public Limit(double distance, Extent extent)
14    {
15        super();
16        this.distance = distance;
17        this.extent = extent;
18    }
19
20    public Limit(Extent extent)
21    {
22        super();
23        this.extent = extent;
24    }
25
26    public Limit()
27    {
28        this.distance = Double.POSITIVE_INFINITY;
29        this.extent = new Extent(BigDecimal.valueOf(LOWER_BOUND),
30                BigDecimal.valueOf(LOWER_BOUND), BigDecimal
31                        .valueOf(UPPER_BOUND), BigDecimal
32                        .valueOf(UPPER_BOUND));
33    }
34
35    public Limit(double distance)
36    {
37        this.distance = distance;
38    }
39
40    public double getDistance()
41    {
42        return distance;
43    }
44
45    public void setDistance(double distance)
46    {
47        this.distance = distance;
48    }
49
50    public Extent getExtent()
51    {
52        return extent;
53    }
54
55    public void setExtent(Extent extent)
56    {
57        this.extent = extent;
58    }
59
60}
Note: See TracBrowser for help on using the browser.