PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/java/src/com/google/publicalerts/cap/Point.java

https://code.google.com/p/cap-library/
Java | 446 lines | 394 code | 43 blank | 9 comment | 56 complexity | 3d4e4f3323381625e53434881c8dd376 MD5 | raw file
Possible License(s): Apache-2.0
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. package com.google.publicalerts.cap;
  3. public final class Point extends
  4. com.google.protobuf.GeneratedMessage
  5. implements PointOrBuilder {
  6. // Use Point.newBuilder() to construct.
  7. private Point(Builder builder) {
  8. super(builder);
  9. }
  10. private Point(boolean noInit) {}
  11. private static final Point defaultInstance;
  12. public static Point getDefaultInstance() {
  13. return defaultInstance;
  14. }
  15. public Point getDefaultInstanceForType() {
  16. return defaultInstance;
  17. }
  18. public static final com.google.protobuf.Descriptors.Descriptor
  19. getDescriptor() {
  20. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_descriptor;
  21. }
  22. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  23. internalGetFieldAccessorTable() {
  24. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_fieldAccessorTable;
  25. }
  26. private int bitField0_;
  27. // required double latitude = 1;
  28. public static final int LATITUDE_FIELD_NUMBER = 1;
  29. private double latitude_;
  30. public boolean hasLatitude() {
  31. return ((bitField0_ & 0x00000001) == 0x00000001);
  32. }
  33. public double getLatitude() {
  34. return latitude_;
  35. }
  36. // required double longitude = 2;
  37. public static final int LONGITUDE_FIELD_NUMBER = 2;
  38. private double longitude_;
  39. public boolean hasLongitude() {
  40. return ((bitField0_ & 0x00000002) == 0x00000002);
  41. }
  42. public double getLongitude() {
  43. return longitude_;
  44. }
  45. private void initFields() {
  46. latitude_ = 0D;
  47. longitude_ = 0D;
  48. }
  49. private byte memoizedIsInitialized = -1;
  50. public final boolean isInitialized() {
  51. byte isInitialized = memoizedIsInitialized;
  52. if (isInitialized != -1) return isInitialized == 1;
  53. if (!hasLatitude()) {
  54. memoizedIsInitialized = 0;
  55. return false;
  56. }
  57. if (!hasLongitude()) {
  58. memoizedIsInitialized = 0;
  59. return false;
  60. }
  61. memoizedIsInitialized = 1;
  62. return true;
  63. }
  64. public void writeTo(com.google.protobuf.CodedOutputStream output)
  65. throws java.io.IOException {
  66. getSerializedSize();
  67. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  68. output.writeDouble(1, latitude_);
  69. }
  70. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  71. output.writeDouble(2, longitude_);
  72. }
  73. getUnknownFields().writeTo(output);
  74. }
  75. private int memoizedSerializedSize = -1;
  76. public int getSerializedSize() {
  77. int size = memoizedSerializedSize;
  78. if (size != -1) return size;
  79. size = 0;
  80. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  81. size += com.google.protobuf.CodedOutputStream
  82. .computeDoubleSize(1, latitude_);
  83. }
  84. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  85. size += com.google.protobuf.CodedOutputStream
  86. .computeDoubleSize(2, longitude_);
  87. }
  88. size += getUnknownFields().getSerializedSize();
  89. memoizedSerializedSize = size;
  90. return size;
  91. }
  92. private static final long serialVersionUID = 0L;
  93. @java.lang.Override
  94. protected java.lang.Object writeReplace()
  95. throws java.io.ObjectStreamException {
  96. return super.writeReplace();
  97. }
  98. @java.lang.Override
  99. public boolean equals(final java.lang.Object obj) {
  100. if (obj == this) {
  101. return true;
  102. }
  103. if (!(obj instanceof com.google.publicalerts.cap.Point)) {
  104. return super.equals(obj);
  105. }
  106. com.google.publicalerts.cap.Point other = (com.google.publicalerts.cap.Point) obj;
  107. boolean result = true;
  108. result = result && (hasLatitude() == other.hasLatitude());
  109. if (hasLatitude()) {
  110. result = result && (Double.doubleToLongBits(getLatitude()) == Double.doubleToLongBits(other.getLatitude()));
  111. }
  112. result = result && (hasLongitude() == other.hasLongitude());
  113. if (hasLongitude()) {
  114. result = result && (Double.doubleToLongBits(getLongitude()) == Double.doubleToLongBits(other.getLongitude()));
  115. }
  116. result = result &&
  117. getUnknownFields().equals(other.getUnknownFields());
  118. return result;
  119. }
  120. @java.lang.Override
  121. public int hashCode() {
  122. int hash = 41;
  123. hash = (19 * hash) + getDescriptorForType().hashCode();
  124. if (hasLatitude()) {
  125. hash = (37 * hash) + LATITUDE_FIELD_NUMBER;
  126. hash = (53 * hash) + hashLong(
  127. Double.doubleToLongBits(getLatitude()));
  128. }
  129. if (hasLongitude()) {
  130. hash = (37 * hash) + LONGITUDE_FIELD_NUMBER;
  131. hash = (53 * hash) + hashLong(
  132. Double.doubleToLongBits(getLongitude()));
  133. }
  134. hash = (29 * hash) + getUnknownFields().hashCode();
  135. return hash;
  136. }
  137. public static com.google.publicalerts.cap.Point parseFrom(
  138. com.google.protobuf.ByteString data)
  139. throws com.google.protobuf.InvalidProtocolBufferException {
  140. return newBuilder().mergeFrom(data).buildParsed();
  141. }
  142. public static com.google.publicalerts.cap.Point parseFrom(
  143. com.google.protobuf.ByteString data,
  144. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  145. throws com.google.protobuf.InvalidProtocolBufferException {
  146. return newBuilder().mergeFrom(data, extensionRegistry)
  147. .buildParsed();
  148. }
  149. public static com.google.publicalerts.cap.Point parseFrom(byte[] data)
  150. throws com.google.protobuf.InvalidProtocolBufferException {
  151. return newBuilder().mergeFrom(data).buildParsed();
  152. }
  153. public static com.google.publicalerts.cap.Point parseFrom(
  154. byte[] data,
  155. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  156. throws com.google.protobuf.InvalidProtocolBufferException {
  157. return newBuilder().mergeFrom(data, extensionRegistry)
  158. .buildParsed();
  159. }
  160. public static com.google.publicalerts.cap.Point parseFrom(java.io.InputStream input)
  161. throws java.io.IOException {
  162. return newBuilder().mergeFrom(input).buildParsed();
  163. }
  164. public static com.google.publicalerts.cap.Point parseFrom(
  165. java.io.InputStream input,
  166. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  167. throws java.io.IOException {
  168. return newBuilder().mergeFrom(input, extensionRegistry)
  169. .buildParsed();
  170. }
  171. public static com.google.publicalerts.cap.Point parseDelimitedFrom(java.io.InputStream input)
  172. throws java.io.IOException {
  173. Builder builder = newBuilder();
  174. if (builder.mergeDelimitedFrom(input)) {
  175. return builder.buildParsed();
  176. } else {
  177. return null;
  178. }
  179. }
  180. public static com.google.publicalerts.cap.Point parseDelimitedFrom(
  181. java.io.InputStream input,
  182. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  183. throws java.io.IOException {
  184. Builder builder = newBuilder();
  185. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  186. return builder.buildParsed();
  187. } else {
  188. return null;
  189. }
  190. }
  191. public static com.google.publicalerts.cap.Point parseFrom(
  192. com.google.protobuf.CodedInputStream input)
  193. throws java.io.IOException {
  194. return newBuilder().mergeFrom(input).buildParsed();
  195. }
  196. public static com.google.publicalerts.cap.Point parseFrom(
  197. com.google.protobuf.CodedInputStream input,
  198. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  199. throws java.io.IOException {
  200. return newBuilder().mergeFrom(input, extensionRegistry)
  201. .buildParsed();
  202. }
  203. public static Builder newBuilder() { return Builder.create(); }
  204. public Builder newBuilderForType() { return newBuilder(); }
  205. public static Builder newBuilder(com.google.publicalerts.cap.Point prototype) {
  206. return newBuilder().mergeFrom(prototype);
  207. }
  208. public Builder toBuilder() { return newBuilder(this); }
  209. @java.lang.Override
  210. protected Builder newBuilderForType(
  211. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  212. Builder builder = new Builder(parent);
  213. return builder;
  214. }
  215. public static final class Builder extends
  216. com.google.protobuf.GeneratedMessage.Builder<Builder>
  217. implements com.google.publicalerts.cap.PointOrBuilder {
  218. public static final com.google.protobuf.Descriptors.Descriptor
  219. getDescriptor() {
  220. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_descriptor;
  221. }
  222. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  223. internalGetFieldAccessorTable() {
  224. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_fieldAccessorTable;
  225. }
  226. // Construct using com.google.publicalerts.cap.Point.newBuilder()
  227. private Builder() {
  228. maybeForceBuilderInitialization();
  229. }
  230. private Builder(BuilderParent parent) {
  231. super(parent);
  232. maybeForceBuilderInitialization();
  233. }
  234. private void maybeForceBuilderInitialization() {
  235. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  236. }
  237. }
  238. private static Builder create() {
  239. return new Builder();
  240. }
  241. public Builder clear() {
  242. super.clear();
  243. latitude_ = 0D;
  244. bitField0_ = (bitField0_ & ~0x00000001);
  245. longitude_ = 0D;
  246. bitField0_ = (bitField0_ & ~0x00000002);
  247. return this;
  248. }
  249. public Builder clone() {
  250. return create().mergeFrom(buildPartial());
  251. }
  252. public com.google.protobuf.Descriptors.Descriptor
  253. getDescriptorForType() {
  254. return com.google.publicalerts.cap.Point.getDescriptor();
  255. }
  256. public com.google.publicalerts.cap.Point getDefaultInstanceForType() {
  257. return com.google.publicalerts.cap.Point.getDefaultInstance();
  258. }
  259. public com.google.publicalerts.cap.Point build() {
  260. com.google.publicalerts.cap.Point result = buildPartial();
  261. if (!result.isInitialized()) {
  262. throw newUninitializedMessageException(result);
  263. }
  264. return result;
  265. }
  266. private com.google.publicalerts.cap.Point buildParsed()
  267. throws com.google.protobuf.InvalidProtocolBufferException {
  268. com.google.publicalerts.cap.Point result = buildPartial();
  269. if (!result.isInitialized()) {
  270. throw newUninitializedMessageException(
  271. result).asInvalidProtocolBufferException();
  272. }
  273. return result;
  274. }
  275. public com.google.publicalerts.cap.Point buildPartial() {
  276. com.google.publicalerts.cap.Point result = new com.google.publicalerts.cap.Point(this);
  277. int from_bitField0_ = bitField0_;
  278. int to_bitField0_ = 0;
  279. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  280. to_bitField0_ |= 0x00000001;
  281. }
  282. result.latitude_ = latitude_;
  283. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  284. to_bitField0_ |= 0x00000002;
  285. }
  286. result.longitude_ = longitude_;
  287. result.bitField0_ = to_bitField0_;
  288. onBuilt();
  289. return result;
  290. }
  291. public Builder mergeFrom(com.google.protobuf.Message other) {
  292. if (other instanceof com.google.publicalerts.cap.Point) {
  293. return mergeFrom((com.google.publicalerts.cap.Point)other);
  294. } else {
  295. super.mergeFrom(other);
  296. return this;
  297. }
  298. }
  299. public Builder mergeFrom(com.google.publicalerts.cap.Point other) {
  300. if (other == com.google.publicalerts.cap.Point.getDefaultInstance()) return this;
  301. if (other.hasLatitude()) {
  302. setLatitude(other.getLatitude());
  303. }
  304. if (other.hasLongitude()) {
  305. setLongitude(other.getLongitude());
  306. }
  307. this.mergeUnknownFields(other.getUnknownFields());
  308. return this;
  309. }
  310. public final boolean isInitialized() {
  311. if (!hasLatitude()) {
  312. return false;
  313. }
  314. if (!hasLongitude()) {
  315. return false;
  316. }
  317. return true;
  318. }
  319. public Builder mergeFrom(
  320. com.google.protobuf.CodedInputStream input,
  321. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  322. throws java.io.IOException {
  323. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  324. com.google.protobuf.UnknownFieldSet.newBuilder(
  325. this.getUnknownFields());
  326. while (true) {
  327. int tag = input.readTag();
  328. switch (tag) {
  329. case 0:
  330. this.setUnknownFields(unknownFields.build());
  331. onChanged();
  332. return this;
  333. default: {
  334. if (!parseUnknownField(input, unknownFields,
  335. extensionRegistry, tag)) {
  336. this.setUnknownFields(unknownFields.build());
  337. onChanged();
  338. return this;
  339. }
  340. break;
  341. }
  342. case 9: {
  343. bitField0_ |= 0x00000001;
  344. latitude_ = input.readDouble();
  345. break;
  346. }
  347. case 17: {
  348. bitField0_ |= 0x00000002;
  349. longitude_ = input.readDouble();
  350. break;
  351. }
  352. }
  353. }
  354. }
  355. private int bitField0_;
  356. // required double latitude = 1;
  357. private double latitude_ ;
  358. public boolean hasLatitude() {
  359. return ((bitField0_ & 0x00000001) == 0x00000001);
  360. }
  361. public double getLatitude() {
  362. return latitude_;
  363. }
  364. public Builder setLatitude(double value) {
  365. bitField0_ |= 0x00000001;
  366. latitude_ = value;
  367. onChanged();
  368. return this;
  369. }
  370. public Builder clearLatitude() {
  371. bitField0_ = (bitField0_ & ~0x00000001);
  372. latitude_ = 0D;
  373. onChanged();
  374. return this;
  375. }
  376. // required double longitude = 2;
  377. private double longitude_ ;
  378. public boolean hasLongitude() {
  379. return ((bitField0_ & 0x00000002) == 0x00000002);
  380. }
  381. public double getLongitude() {
  382. return longitude_;
  383. }
  384. public Builder setLongitude(double value) {
  385. bitField0_ |= 0x00000002;
  386. longitude_ = value;
  387. onChanged();
  388. return this;
  389. }
  390. public Builder clearLongitude() {
  391. bitField0_ = (bitField0_ & ~0x00000002);
  392. longitude_ = 0D;
  393. onChanged();
  394. return this;
  395. }
  396. // @@protoc_insertion_point(builder_scope:publicalerts.cap.Point)
  397. }
  398. static {
  399. defaultInstance = new Point(true);
  400. defaultInstance.initFields();
  401. }
  402. // @@protoc_insertion_point(class_scope:publicalerts.cap.Point)
  403. }