PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/webportal/src/main/java/au/org/emii/portal/value/BoundingBox.java

http://alageospatialportal.googlecode.com/
Java | 71 lines | 62 code | 9 blank | 0 comment | 0 complexity | f83ace6bdf46111dfed42ed26309d945 MD5 | raw file
 1package au.org.emii.portal.value;
 2
 3import au.org.emii.portal.aspect.CheckNotNull;
 4import java.io.Serializable;
 5
 6public class BoundingBox implements Serializable, Cloneable {
 7
 8	private static final long serialVersionUID = 1L;
 9	private float minLatitude = 0.0f;
10	private float maxLatitude = 0.0f;
11	private float minLongitude = 0.0f;
12	private float maxLongitude = 0.0f;
13	private long id;	
14	
15	public long getId() {
16		return id;
17	}
18
19	public void setId(long id) {
20		this.id = id;
21	}
22
23	public float getMinLatitude() {
24		return minLatitude;
25	}
26	public void setMinLatitude(float minLatitude) {
27		this.minLatitude = minLatitude;
28	}
29	public float getMaxLatitude() {
30		return maxLatitude;
31	}
32	public void setMaxLatitude(float maxLatitude) {
33		this.maxLatitude = maxLatitude;
34	}
35	public float getMinLongitude() {
36		return minLongitude;
37	}
38	public void setMinLongitude(float minLongitude) {
39		this.minLongitude = minLongitude;
40	}
41	public float getMaxLongitude() {
42		return maxLongitude;
43	}
44	public void setMaxLongitude(float maxLongitude) {
45		this.maxLongitude = maxLongitude;
46	}
47
48	@CheckNotNull
49	public void copyFrom(au.org.emii.portal.config.xmlbeans.BoundingBox boundingBox) {
50		setMinLatitude(boundingBox.getMinLatitude());
51		setMaxLatitude(boundingBox.getMaxLatitude());
52		setMinLongitude(boundingBox.getMinLongitude());
53		setMaxLongitude(boundingBox.getMaxLongitude());
54	}
55	
56	public Object clone() throws CloneNotSupportedException {
57		return super.clone();
58	}
59
60        @Override
61        public String toString() {
62            return new StringBuffer(String.valueOf(minLongitude))
63                    .append(",")
64                    .append(String.valueOf(minLatitude))
65                    .append(",")
66                    .append(String.valueOf(maxLongitude))
67                    .append(",")
68                    .append(String.valueOf(maxLatitude))
69                    .toString();
70        }
71}