PageRenderTime 25ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/src/main/java/de/micromata/opengis/kml/v_2_2_0/AbstractLatLonBox.java

http://javaapiforkml.googlecode.com/
Java | 478 lines | 225 code | 35 blank | 218 comment | 32 complexity | 3c7679311c97a8c562c7316b6a8b8c7f MD5 | raw file
Possible License(s): BSD-3-Clause
  1. package de.micromata.opengis.kml.v_2_2_0;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import javax.xml.bind.annotation.XmlAccessType;
  5. import javax.xml.bind.annotation.XmlAccessorType;
  6. import javax.xml.bind.annotation.XmlElement;
  7. import javax.xml.bind.annotation.XmlSchemaType;
  8. import javax.xml.bind.annotation.XmlSeeAlso;
  9. import javax.xml.bind.annotation.XmlType;
  10. import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
  11. /**
  12. * <latlonbox>
  13. * <p>
  14. * Specifies where the top, bottom, right, and left sides of a bounding box for the
  15. * ground overlay are aligned. <north> Specifies the latitude of the north edge of
  16. * the bounding box, in decimal degrees from 0 to ą90. <south> Specifies the latitude
  17. * of the south edge of the bounding box, in decimal degrees from 0 to ą90. <east>
  18. * Specifies the longitude of the east edge of the bounding box, in decimal degrees
  19. * from 0 to ą180. (For overlays that overlap the meridian of 180° longitude, values
  20. * can extend beyond that range.) <west> Specifies the longitude of the west edge of
  21. * the bounding box, in decimal degrees from 0 to ą180. (For overlays that overlap
  22. * the meridian of 180° longitude, values can extend beyond that range.) <rotation>
  23. * Specifies a rotation of the overlay about its center, in degrees. Values can be
  24. * ą180. The default is 0 (north). Rotations are specified in a counterclockwise direction.
  25. * <LatLonBox> <north>48.25475939255556</north> <south>48.25207367852141</south> <east>-90.86591508839973</east>
  26. * <west>-90.8714285289695</west> <rotation>39.37878630116985</rotation> </LatLonBox>
  27. * </p>
  28. *
  29. *
  30. *
  31. */
  32. @XmlAccessorType(XmlAccessType.FIELD)
  33. @XmlType(name = "AbstractLatLonBoxType", propOrder = {
  34. "north",
  35. "south",
  36. "east",
  37. "west",
  38. "abstractLatLonBoxSimpleExtension",
  39. "abstractLatLonBoxObjectExtension"
  40. })
  41. @XmlSeeAlso({
  42. LatLonBox.class,
  43. LatLonAltBox.class
  44. })
  45. public abstract class AbstractLatLonBox
  46. extends AbstractObject
  47. implements Cloneable
  48. {
  49. /**
  50. * <north> (required)
  51. * <p>
  52. * Specifies the latitude of the north edge of the bounding box, in decimal degrees
  53. * from 0 to ą90.
  54. * </p>
  55. *
  56. *
  57. *
  58. */
  59. @XmlElement(defaultValue = "180.0")
  60. protected double north;
  61. /**
  62. * <south> (required)
  63. * <p>
  64. * Specifies the latitude of the south edge of the bounding box, in decimal degrees
  65. * from 0 to ą90.
  66. * </p>
  67. *
  68. *
  69. *
  70. */
  71. @XmlElement(defaultValue = "-180.0")
  72. protected double south;
  73. /**
  74. * <east> (required)
  75. *
  76. *
  77. */
  78. @XmlElement(defaultValue = "180.0")
  79. protected double east;
  80. /**
  81. * <west> (required)
  82. * <p>
  83. * Specifies the longitude of the west edge of the bounding box, in decimal degrees
  84. * from 0 to ą180.
  85. * </p>
  86. *
  87. *
  88. *
  89. */
  90. @XmlElement(defaultValue = "-180.0")
  91. protected double west;
  92. @XmlElement(name = "AbstractLatLonBoxSimpleExtensionGroup")
  93. @XmlSchemaType(name = "anySimpleType")
  94. protected List<Object> abstractLatLonBoxSimpleExtension;
  95. /**
  96. * <Object>
  97. * <p>
  98. * This is an abstract base class and cannot be used directly in a KML file. It provides
  99. * the id attribute, which allows unique identification of a KML element, and the targetId
  100. * attribute, which is used to reference objects that have already been loaded into
  101. * Google Earth. The id attribute must be assigned if the <Update> mechanism is to
  102. * be used.
  103. * </p>
  104. *
  105. * Syntax:
  106. * <pre>&lt;!-- abstract element; do not create --&gt;<strong>
  107. * &lt;!-- <em>Object</em> id="ID" targetId="NCName" --&gt;
  108. * &lt;!-- /<em>Object</em>&gt; --&gt;</strong></pre>
  109. *
  110. *
  111. *
  112. */
  113. @XmlElement(name = "AbstractLatLonBoxObjectExtensionGroup")
  114. protected List<AbstractObject> abstractLatLonBoxObjectExtension;
  115. public AbstractLatLonBox() {
  116. super();
  117. }
  118. /**
  119. * @see north
  120. *
  121. * @return
  122. * possible object is
  123. * {@link Double}
  124. *
  125. */
  126. public double getNorth() {
  127. return north;
  128. }
  129. /**
  130. * @see north
  131. *
  132. * @param value
  133. * allowed object is
  134. * {@link Double}
  135. *
  136. */
  137. public void setNorth(double value) {
  138. this.north = value;
  139. }
  140. /**
  141. * @see south
  142. *
  143. * @return
  144. * possible object is
  145. * {@link Double}
  146. *
  147. */
  148. public double getSouth() {
  149. return south;
  150. }
  151. /**
  152. * @see south
  153. *
  154. * @param value
  155. * allowed object is
  156. * {@link Double}
  157. *
  158. */
  159. public void setSouth(double value) {
  160. this.south = value;
  161. }
  162. /**
  163. * @see east
  164. *
  165. * @return
  166. * possible object is
  167. * {@link Double}
  168. *
  169. */
  170. public double getEast() {
  171. return east;
  172. }
  173. /**
  174. * @see east
  175. *
  176. * @param value
  177. * allowed object is
  178. * {@link Double}
  179. *
  180. */
  181. public void setEast(double value) {
  182. this.east = value;
  183. }
  184. /**
  185. * @see west
  186. *
  187. * @return
  188. * possible object is
  189. * {@link Double}
  190. *
  191. */
  192. public double getWest() {
  193. return west;
  194. }
  195. /**
  196. * @see west
  197. *
  198. * @param value
  199. * allowed object is
  200. * {@link Double}
  201. *
  202. */
  203. public void setWest(double value) {
  204. this.west = value;
  205. }
  206. /**
  207. * @see abstractLatLonBoxSimpleExtension
  208. *
  209. */
  210. public List<Object> getAbstractLatLonBoxSimpleExtension() {
  211. if (abstractLatLonBoxSimpleExtension == null) {
  212. abstractLatLonBoxSimpleExtension = new ArrayList<Object>();
  213. }
  214. return this.abstractLatLonBoxSimpleExtension;
  215. }
  216. /**
  217. * @see abstractLatLonBoxObjectExtension
  218. *
  219. */
  220. public List<AbstractObject> getAbstractLatLonBoxObjectExtension() {
  221. if (abstractLatLonBoxObjectExtension == null) {
  222. abstractLatLonBoxObjectExtension = new ArrayList<AbstractObject>();
  223. }
  224. return this.abstractLatLonBoxObjectExtension;
  225. }
  226. @Override
  227. public int hashCode() {
  228. final int prime = 31;
  229. int result = super.hashCode();
  230. long temp;
  231. temp = Double.doubleToLongBits(north);
  232. result = ((prime*result)+((int)(temp^(temp >>>(32)))));
  233. temp = Double.doubleToLongBits(south);
  234. result = ((prime*result)+((int)(temp^(temp >>>(32)))));
  235. temp = Double.doubleToLongBits(east);
  236. result = ((prime*result)+((int)(temp^(temp >>>(32)))));
  237. temp = Double.doubleToLongBits(west);
  238. result = ((prime*result)+((int)(temp^(temp >>>(32)))));
  239. result = ((prime*result)+((abstractLatLonBoxSimpleExtension == null)? 0 :abstractLatLonBoxSimpleExtension.hashCode()));
  240. result = ((prime*result)+((abstractLatLonBoxObjectExtension == null)? 0 :abstractLatLonBoxObjectExtension.hashCode()));
  241. return result;
  242. }
  243. @Override
  244. public boolean equals(Object obj) {
  245. if (this == obj) {
  246. return true;
  247. }
  248. if (obj == null) {
  249. return false;
  250. }
  251. if (super.equals(obj) == false) {
  252. return false;
  253. }
  254. if ((obj instanceof AbstractLatLonBox) == false) {
  255. return false;
  256. }
  257. AbstractLatLonBox other = ((AbstractLatLonBox) obj);
  258. if (north!= other.north) {
  259. return false;
  260. }
  261. if (south!= other.south) {
  262. return false;
  263. }
  264. if (east!= other.east) {
  265. return false;
  266. }
  267. if (west!= other.west) {
  268. return false;
  269. }
  270. if (abstractLatLonBoxSimpleExtension == null) {
  271. if (other.abstractLatLonBoxSimpleExtension!= null) {
  272. return false;
  273. }
  274. } else {
  275. if (abstractLatLonBoxSimpleExtension.equals(other.abstractLatLonBoxSimpleExtension) == false) {
  276. return false;
  277. }
  278. }
  279. if (abstractLatLonBoxObjectExtension == null) {
  280. if (other.abstractLatLonBoxObjectExtension!= null) {
  281. return false;
  282. }
  283. } else {
  284. if (abstractLatLonBoxObjectExtension.equals(other.abstractLatLonBoxObjectExtension) == false) {
  285. return false;
  286. }
  287. }
  288. return true;
  289. }
  290. /**
  291. * @see abstractLatLonBoxSimpleExtension
  292. *
  293. * @param abstractLatLonBoxSimpleExtension
  294. */
  295. public void setAbstractLatLonBoxSimpleExtension(final List<Object> abstractLatLonBoxSimpleExtension) {
  296. this.abstractLatLonBoxSimpleExtension = abstractLatLonBoxSimpleExtension;
  297. }
  298. /**
  299. * add a value to the abstractLatLonBoxSimpleExtension property collection
  300. *
  301. * @param abstractLatLonBoxSimpleExtension
  302. * Objects of the following type are allowed in the list: {@link Object}
  303. * @return
  304. * <tt>true</tt> (as general contract of <tt>Collection.add</tt>).
  305. */
  306. public AbstractLatLonBox addToAbstractLatLonBoxSimpleExtension(final Object abstractLatLonBoxSimpleExtension) {
  307. this.getAbstractLatLonBoxSimpleExtension().add(abstractLatLonBoxSimpleExtension);
  308. return this;
  309. }
  310. /**
  311. * @see abstractLatLonBoxObjectExtension
  312. *
  313. * @param abstractLatLonBoxObjectExtension
  314. */
  315. public void setAbstractLatLonBoxObjectExtension(final List<AbstractObject> abstractLatLonBoxObjectExtension) {
  316. this.abstractLatLonBoxObjectExtension = abstractLatLonBoxObjectExtension;
  317. }
  318. /**
  319. * add a value to the abstractLatLonBoxObjectExtension property collection
  320. *
  321. * @param abstractLatLonBoxObjectExtension
  322. * Objects of the following type are allowed in the list: {@link AbstractObject}
  323. * @return
  324. * <tt>true</tt> (as general contract of <tt>Collection.add</tt>).
  325. */
  326. public AbstractLatLonBox addToAbstractLatLonBoxObjectExtension(final AbstractObject abstractLatLonBoxObjectExtension) {
  327. this.getAbstractLatLonBoxObjectExtension().add(abstractLatLonBoxObjectExtension);
  328. return this;
  329. }
  330. /**
  331. * @see objectSimpleExtension
  332. *
  333. */
  334. @Obvious
  335. @Override
  336. public void setObjectSimpleExtension(final List<Object> objectSimpleExtension) {
  337. super.setObjectSimpleExtension(objectSimpleExtension);
  338. }
  339. @Obvious
  340. @Override
  341. public AbstractLatLonBox addToObjectSimpleExtension(final Object objectSimpleExtension) {
  342. super.getObjectSimpleExtension().add(objectSimpleExtension);
  343. return this;
  344. }
  345. /**
  346. * fluent setter
  347. * @see #setNorth(double)
  348. *
  349. * @param north
  350. * required parameter
  351. */
  352. public AbstractLatLonBox withNorth(final double north) {
  353. this.setNorth(north);
  354. return this;
  355. }
  356. /**
  357. * fluent setter
  358. * @see #setSouth(double)
  359. *
  360. * @param south
  361. * required parameter
  362. */
  363. public AbstractLatLonBox withSouth(final double south) {
  364. this.setSouth(south);
  365. return this;
  366. }
  367. /**
  368. * fluent setter
  369. * @see #setEast(double)
  370. *
  371. * @param east
  372. * required parameter
  373. */
  374. public AbstractLatLonBox withEast(final double east) {
  375. this.setEast(east);
  376. return this;
  377. }
  378. /**
  379. * fluent setter
  380. * @see #setWest(double)
  381. *
  382. * @param west
  383. * required parameter
  384. */
  385. public AbstractLatLonBox withWest(final double west) {
  386. this.setWest(west);
  387. return this;
  388. }
  389. /**
  390. * fluent setter
  391. * @see #setAbstractLatLonBoxSimpleExtension(List<Object>)
  392. *
  393. * @param abstractLatLonBoxSimpleExtension
  394. * required parameter
  395. */
  396. public AbstractLatLonBox withAbstractLatLonBoxSimpleExtension(final List<Object> abstractLatLonBoxSimpleExtension) {
  397. this.setAbstractLatLonBoxSimpleExtension(abstractLatLonBoxSimpleExtension);
  398. return this;
  399. }
  400. /**
  401. * fluent setter
  402. * @see #setAbstractLatLonBoxObjectExtension(List<AbstractObject>)
  403. *
  404. * @param abstractLatLonBoxObjectExtension
  405. * required parameter
  406. */
  407. public AbstractLatLonBox withAbstractLatLonBoxObjectExtension(final List<AbstractObject> abstractLatLonBoxObjectExtension) {
  408. this.setAbstractLatLonBoxObjectExtension(abstractLatLonBoxObjectExtension);
  409. return this;
  410. }
  411. @Obvious
  412. @Override
  413. public AbstractLatLonBox withObjectSimpleExtension(final List<Object> objectSimpleExtension) {
  414. super.withObjectSimpleExtension(objectSimpleExtension);
  415. return this;
  416. }
  417. @Obvious
  418. @Override
  419. public AbstractLatLonBox withId(final String id) {
  420. super.withId(id);
  421. return this;
  422. }
  423. @Obvious
  424. @Override
  425. public AbstractLatLonBox withTargetId(final String targetId) {
  426. super.withTargetId(targetId);
  427. return this;
  428. }
  429. @Override
  430. public AbstractLatLonBox clone() {
  431. AbstractLatLonBox copy;
  432. copy = ((AbstractLatLonBox) super.clone());
  433. copy.abstractLatLonBoxSimpleExtension = new ArrayList<Object>((getAbstractLatLonBoxSimpleExtension().size()));
  434. for (Object iter: abstractLatLonBoxSimpleExtension) {
  435. copy.abstractLatLonBoxSimpleExtension.add(iter);
  436. }
  437. copy.abstractLatLonBoxObjectExtension = new ArrayList<AbstractObject>((getAbstractLatLonBoxObjectExtension().size()));
  438. for (AbstractObject iter: abstractLatLonBoxObjectExtension) {
  439. copy.abstractLatLonBoxObjectExtension.add(iter.clone());
  440. }
  441. return copy;
  442. }
  443. }