3
3
import lombok .Builder ;
4
4
import lombok .Getter ;
5
5
import lombok .Setter ;
6
- import lombok .ToString ;
7
6
8
7
import java .util .Objects ;
9
8
10
9
/**
11
10
* Represents a rectangular geographical area on a map.
11
+ *
12
12
* @author Mehdi Akbarian Rastaghi (@makbn)
13
13
*/
14
14
@ Getter
@@ -86,12 +86,12 @@ public JLLatLng getCenter() {
86
86
*/
87
87
public String toBBoxString () {
88
88
return String .format ("%f,%f,%f,%f" , southWest .getLng (), southWest .getLat (),
89
- northEast .getLat (), northEast .getLat ());
89
+ northEast .getLng (), northEast .getLat ());
90
90
}
91
91
92
92
/**
93
93
* @param bounds given bounds
94
- * @return {{@link Boolean#TRUE} } if the rectangle contains the given bounds.
94
+ * @return {@code true } if the rectangle contains the given bounds.
95
95
*/
96
96
public boolean contains (JLBounds bounds ) {
97
97
return (bounds .getSouthWest ().getLat () >= southWest .getLat ())
@@ -102,7 +102,7 @@ public boolean contains(JLBounds bounds) {
102
102
103
103
/**
104
104
* @param point given point
105
- * @return {{@link Boolean#TRUE} } if the rectangle contains the given point.
105
+ * @return {@code true } if the rectangle contains the given point.
106
106
*/
107
107
public boolean contains (JLLatLng point ) {
108
108
return (point .getLat () >= southWest .getLat ())
@@ -125,20 +125,20 @@ public boolean isValid() {
125
125
* Negative values will retract the bounds.
126
126
*/
127
127
public JLBounds pad (double bufferRatio ) {
128
- double heightBuffer = Math .abs (southWest .getLat () - northEast .getLat ()) * bufferRatio ;
129
- double widthBuffer = Math .abs (southWest .getLng () - northEast .getLng ()) * bufferRatio ;
128
+ double latBuffer = Math .abs (southWest .getLat () - northEast .getLat ()) * bufferRatio ;
129
+ double lngBuffer = Math .abs (southWest .getLng () - northEast .getLng ()) * bufferRatio ;
130
130
131
131
return new JLBounds (
132
- new JLLatLng (southWest .getLat () - heightBuffer , southWest .getLng () - widthBuffer ),
133
- new JLLatLng (northEast .getLat () + heightBuffer , northEast .getLng () + widthBuffer ));
132
+ new JLLatLng (southWest .getLat () - latBuffer , southWest .getLng () - lngBuffer ),
133
+ new JLLatLng (northEast .getLat () + latBuffer , northEast .getLng () + lngBuffer ));
134
134
}
135
135
136
136
/**
137
137
* @param bounds the given bounds
138
138
* @param maxMargin The margin of error
139
- * @return {{@link Boolean#TRUE}} if the rectangle is equivalent (within a small margin of error) to the given bounds.
139
+ * @return true if the rectangle is equivalent (within a small margin of error) to the given bounds.
140
140
*/
141
- public boolean equals (JLBounds bounds , int maxMargin ) {
141
+ public boolean equals (JLBounds bounds , float maxMargin ) {
142
142
if (bounds == null ) {
143
143
return false ;
144
144
}
0 commit comments