PageRenderTime 46ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://code.google.com/p/cap-library/
Java | 584 lines | 535 code | 42 blank | 7 comment | 100 complexity | e3f269eb7ad2728096c2249bfa856233 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 Polygon extends
  4. com.google.protobuf.GeneratedMessage
  5. implements PolygonOrBuilder {
  6. // Use Polygon.newBuilder() to construct.
  7. private Polygon(Builder builder) {
  8. super(builder);
  9. }
  10. private Polygon(boolean noInit) {}
  11. private static final Polygon defaultInstance;
  12. public static Polygon getDefaultInstance() {
  13. return defaultInstance;
  14. }
  15. public Polygon 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_Polygon_descriptor;
  21. }
  22. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  23. internalGetFieldAccessorTable() {
  24. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Polygon_fieldAccessorTable;
  25. }
  26. // repeated .publicalerts.cap.Point point = 1;
  27. public static final int POINT_FIELD_NUMBER = 1;
  28. private java.util.List<com.google.publicalerts.cap.Point> point_;
  29. public java.util.List<com.google.publicalerts.cap.Point> getPointList() {
  30. return point_;
  31. }
  32. public java.util.List<? extends com.google.publicalerts.cap.PointOrBuilder>
  33. getPointOrBuilderList() {
  34. return point_;
  35. }
  36. public int getPointCount() {
  37. return point_.size();
  38. }
  39. public com.google.publicalerts.cap.Point getPoint(int index) {
  40. return point_.get(index);
  41. }
  42. public com.google.publicalerts.cap.PointOrBuilder getPointOrBuilder(
  43. int index) {
  44. return point_.get(index);
  45. }
  46. private void initFields() {
  47. point_ = java.util.Collections.emptyList();
  48. }
  49. private byte memoizedIsInitialized = -1;
  50. public final boolean isInitialized() {
  51. byte isInitialized = memoizedIsInitialized;
  52. if (isInitialized != -1) return isInitialized == 1;
  53. for (int i = 0; i < getPointCount(); i++) {
  54. if (!getPoint(i).isInitialized()) {
  55. memoizedIsInitialized = 0;
  56. return false;
  57. }
  58. }
  59. memoizedIsInitialized = 1;
  60. return true;
  61. }
  62. public void writeTo(com.google.protobuf.CodedOutputStream output)
  63. throws java.io.IOException {
  64. getSerializedSize();
  65. for (int i = 0; i < point_.size(); i++) {
  66. output.writeMessage(1, point_.get(i));
  67. }
  68. getUnknownFields().writeTo(output);
  69. }
  70. private int memoizedSerializedSize = -1;
  71. public int getSerializedSize() {
  72. int size = memoizedSerializedSize;
  73. if (size != -1) return size;
  74. size = 0;
  75. for (int i = 0; i < point_.size(); i++) {
  76. size += com.google.protobuf.CodedOutputStream
  77. .computeMessageSize(1, point_.get(i));
  78. }
  79. size += getUnknownFields().getSerializedSize();
  80. memoizedSerializedSize = size;
  81. return size;
  82. }
  83. private static final long serialVersionUID = 0L;
  84. @java.lang.Override
  85. protected java.lang.Object writeReplace()
  86. throws java.io.ObjectStreamException {
  87. return super.writeReplace();
  88. }
  89. @java.lang.Override
  90. public boolean equals(final java.lang.Object obj) {
  91. if (obj == this) {
  92. return true;
  93. }
  94. if (!(obj instanceof com.google.publicalerts.cap.Polygon)) {
  95. return super.equals(obj);
  96. }
  97. com.google.publicalerts.cap.Polygon other = (com.google.publicalerts.cap.Polygon) obj;
  98. boolean result = true;
  99. result = result && getPointList()
  100. .equals(other.getPointList());
  101. result = result &&
  102. getUnknownFields().equals(other.getUnknownFields());
  103. return result;
  104. }
  105. @java.lang.Override
  106. public int hashCode() {
  107. int hash = 41;
  108. hash = (19 * hash) + getDescriptorForType().hashCode();
  109. if (getPointCount() > 0) {
  110. hash = (37 * hash) + POINT_FIELD_NUMBER;
  111. hash = (53 * hash) + getPointList().hashCode();
  112. }
  113. hash = (29 * hash) + getUnknownFields().hashCode();
  114. return hash;
  115. }
  116. public static com.google.publicalerts.cap.Polygon parseFrom(
  117. com.google.protobuf.ByteString data)
  118. throws com.google.protobuf.InvalidProtocolBufferException {
  119. return newBuilder().mergeFrom(data).buildParsed();
  120. }
  121. public static com.google.publicalerts.cap.Polygon parseFrom(
  122. com.google.protobuf.ByteString data,
  123. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  124. throws com.google.protobuf.InvalidProtocolBufferException {
  125. return newBuilder().mergeFrom(data, extensionRegistry)
  126. .buildParsed();
  127. }
  128. public static com.google.publicalerts.cap.Polygon parseFrom(byte[] data)
  129. throws com.google.protobuf.InvalidProtocolBufferException {
  130. return newBuilder().mergeFrom(data).buildParsed();
  131. }
  132. public static com.google.publicalerts.cap.Polygon parseFrom(
  133. byte[] data,
  134. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  135. throws com.google.protobuf.InvalidProtocolBufferException {
  136. return newBuilder().mergeFrom(data, extensionRegistry)
  137. .buildParsed();
  138. }
  139. public static com.google.publicalerts.cap.Polygon parseFrom(java.io.InputStream input)
  140. throws java.io.IOException {
  141. return newBuilder().mergeFrom(input).buildParsed();
  142. }
  143. public static com.google.publicalerts.cap.Polygon parseFrom(
  144. java.io.InputStream input,
  145. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  146. throws java.io.IOException {
  147. return newBuilder().mergeFrom(input, extensionRegistry)
  148. .buildParsed();
  149. }
  150. public static com.google.publicalerts.cap.Polygon parseDelimitedFrom(java.io.InputStream input)
  151. throws java.io.IOException {
  152. Builder builder = newBuilder();
  153. if (builder.mergeDelimitedFrom(input)) {
  154. return builder.buildParsed();
  155. } else {
  156. return null;
  157. }
  158. }
  159. public static com.google.publicalerts.cap.Polygon parseDelimitedFrom(
  160. java.io.InputStream input,
  161. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  162. throws java.io.IOException {
  163. Builder builder = newBuilder();
  164. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  165. return builder.buildParsed();
  166. } else {
  167. return null;
  168. }
  169. }
  170. public static com.google.publicalerts.cap.Polygon parseFrom(
  171. com.google.protobuf.CodedInputStream input)
  172. throws java.io.IOException {
  173. return newBuilder().mergeFrom(input).buildParsed();
  174. }
  175. public static com.google.publicalerts.cap.Polygon parseFrom(
  176. com.google.protobuf.CodedInputStream input,
  177. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  178. throws java.io.IOException {
  179. return newBuilder().mergeFrom(input, extensionRegistry)
  180. .buildParsed();
  181. }
  182. public static Builder newBuilder() { return Builder.create(); }
  183. public Builder newBuilderForType() { return newBuilder(); }
  184. public static Builder newBuilder(com.google.publicalerts.cap.Polygon prototype) {
  185. return newBuilder().mergeFrom(prototype);
  186. }
  187. public Builder toBuilder() { return newBuilder(this); }
  188. @java.lang.Override
  189. protected Builder newBuilderForType(
  190. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  191. Builder builder = new Builder(parent);
  192. return builder;
  193. }
  194. public static final class Builder extends
  195. com.google.protobuf.GeneratedMessage.Builder<Builder>
  196. implements com.google.publicalerts.cap.PolygonOrBuilder {
  197. public static final com.google.protobuf.Descriptors.Descriptor
  198. getDescriptor() {
  199. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Polygon_descriptor;
  200. }
  201. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  202. internalGetFieldAccessorTable() {
  203. return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Polygon_fieldAccessorTable;
  204. }
  205. // Construct using com.google.publicalerts.cap.Polygon.newBuilder()
  206. private Builder() {
  207. maybeForceBuilderInitialization();
  208. }
  209. private Builder(BuilderParent parent) {
  210. super(parent);
  211. maybeForceBuilderInitialization();
  212. }
  213. private void maybeForceBuilderInitialization() {
  214. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  215. getPointFieldBuilder();
  216. }
  217. }
  218. private static Builder create() {
  219. return new Builder();
  220. }
  221. public Builder clear() {
  222. super.clear();
  223. if (pointBuilder_ == null) {
  224. point_ = java.util.Collections.emptyList();
  225. bitField0_ = (bitField0_ & ~0x00000001);
  226. } else {
  227. pointBuilder_.clear();
  228. }
  229. return this;
  230. }
  231. public Builder clone() {
  232. return create().mergeFrom(buildPartial());
  233. }
  234. public com.google.protobuf.Descriptors.Descriptor
  235. getDescriptorForType() {
  236. return com.google.publicalerts.cap.Polygon.getDescriptor();
  237. }
  238. public com.google.publicalerts.cap.Polygon getDefaultInstanceForType() {
  239. return com.google.publicalerts.cap.Polygon.getDefaultInstance();
  240. }
  241. public com.google.publicalerts.cap.Polygon build() {
  242. com.google.publicalerts.cap.Polygon result = buildPartial();
  243. if (!result.isInitialized()) {
  244. throw newUninitializedMessageException(result);
  245. }
  246. return result;
  247. }
  248. private com.google.publicalerts.cap.Polygon buildParsed()
  249. throws com.google.protobuf.InvalidProtocolBufferException {
  250. com.google.publicalerts.cap.Polygon result = buildPartial();
  251. if (!result.isInitialized()) {
  252. throw newUninitializedMessageException(
  253. result).asInvalidProtocolBufferException();
  254. }
  255. return result;
  256. }
  257. public com.google.publicalerts.cap.Polygon buildPartial() {
  258. com.google.publicalerts.cap.Polygon result = new com.google.publicalerts.cap.Polygon(this);
  259. int from_bitField0_ = bitField0_;
  260. if (pointBuilder_ == null) {
  261. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  262. point_ = java.util.Collections.unmodifiableList(point_);
  263. bitField0_ = (bitField0_ & ~0x00000001);
  264. }
  265. result.point_ = point_;
  266. } else {
  267. result.point_ = pointBuilder_.build();
  268. }
  269. onBuilt();
  270. return result;
  271. }
  272. public Builder mergeFrom(com.google.protobuf.Message other) {
  273. if (other instanceof com.google.publicalerts.cap.Polygon) {
  274. return mergeFrom((com.google.publicalerts.cap.Polygon)other);
  275. } else {
  276. super.mergeFrom(other);
  277. return this;
  278. }
  279. }
  280. public Builder mergeFrom(com.google.publicalerts.cap.Polygon other) {
  281. if (other == com.google.publicalerts.cap.Polygon.getDefaultInstance()) return this;
  282. if (pointBuilder_ == null) {
  283. if (!other.point_.isEmpty()) {
  284. if (point_.isEmpty()) {
  285. point_ = other.point_;
  286. bitField0_ = (bitField0_ & ~0x00000001);
  287. } else {
  288. ensurePointIsMutable();
  289. point_.addAll(other.point_);
  290. }
  291. onChanged();
  292. }
  293. } else {
  294. if (!other.point_.isEmpty()) {
  295. if (pointBuilder_.isEmpty()) {
  296. pointBuilder_.dispose();
  297. pointBuilder_ = null;
  298. point_ = other.point_;
  299. bitField0_ = (bitField0_ & ~0x00000001);
  300. pointBuilder_ =
  301. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  302. getPointFieldBuilder() : null;
  303. } else {
  304. pointBuilder_.addAllMessages(other.point_);
  305. }
  306. }
  307. }
  308. this.mergeUnknownFields(other.getUnknownFields());
  309. return this;
  310. }
  311. public final boolean isInitialized() {
  312. for (int i = 0; i < getPointCount(); i++) {
  313. if (!getPoint(i).isInitialized()) {
  314. return false;
  315. }
  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 10: {
  343. com.google.publicalerts.cap.Point.Builder subBuilder = com.google.publicalerts.cap.Point.newBuilder();
  344. input.readMessage(subBuilder, extensionRegistry);
  345. addPoint(subBuilder.buildPartial());
  346. break;
  347. }
  348. }
  349. }
  350. }
  351. private int bitField0_;
  352. // repeated .publicalerts.cap.Point point = 1;
  353. private java.util.List<com.google.publicalerts.cap.Point> point_ =
  354. java.util.Collections.emptyList();
  355. private void ensurePointIsMutable() {
  356. if (!((bitField0_ & 0x00000001) == 0x00000001)) {
  357. point_ = new java.util.ArrayList<com.google.publicalerts.cap.Point>(point_);
  358. bitField0_ |= 0x00000001;
  359. }
  360. }
  361. private com.google.protobuf.RepeatedFieldBuilder<
  362. com.google.publicalerts.cap.Point, com.google.publicalerts.cap.Point.Builder, com.google.publicalerts.cap.PointOrBuilder> pointBuilder_;
  363. public java.util.List<com.google.publicalerts.cap.Point> getPointList() {
  364. if (pointBuilder_ == null) {
  365. return java.util.Collections.unmodifiableList(point_);
  366. } else {
  367. return pointBuilder_.getMessageList();
  368. }
  369. }
  370. public int getPointCount() {
  371. if (pointBuilder_ == null) {
  372. return point_.size();
  373. } else {
  374. return pointBuilder_.getCount();
  375. }
  376. }
  377. public com.google.publicalerts.cap.Point getPoint(int index) {
  378. if (pointBuilder_ == null) {
  379. return point_.get(index);
  380. } else {
  381. return pointBuilder_.getMessage(index);
  382. }
  383. }
  384. public Builder setPoint(
  385. int index, com.google.publicalerts.cap.Point value) {
  386. if (pointBuilder_ == null) {
  387. if (value == null) {
  388. throw new NullPointerException();
  389. }
  390. ensurePointIsMutable();
  391. point_.set(index, value);
  392. onChanged();
  393. } else {
  394. pointBuilder_.setMessage(index, value);
  395. }
  396. return this;
  397. }
  398. public Builder setPoint(
  399. int index, com.google.publicalerts.cap.Point.Builder builderForValue) {
  400. if (pointBuilder_ == null) {
  401. ensurePointIsMutable();
  402. point_.set(index, builderForValue.build());
  403. onChanged();
  404. } else {
  405. pointBuilder_.setMessage(index, builderForValue.build());
  406. }
  407. return this;
  408. }
  409. public Builder addPoint(com.google.publicalerts.cap.Point value) {
  410. if (pointBuilder_ == null) {
  411. if (value == null) {
  412. throw new NullPointerException();
  413. }
  414. ensurePointIsMutable();
  415. point_.add(value);
  416. onChanged();
  417. } else {
  418. pointBuilder_.addMessage(value);
  419. }
  420. return this;
  421. }
  422. public Builder addPoint(
  423. int index, com.google.publicalerts.cap.Point value) {
  424. if (pointBuilder_ == null) {
  425. if (value == null) {
  426. throw new NullPointerException();
  427. }
  428. ensurePointIsMutable();
  429. point_.add(index, value);
  430. onChanged();
  431. } else {
  432. pointBuilder_.addMessage(index, value);
  433. }
  434. return this;
  435. }
  436. public Builder addPoint(
  437. com.google.publicalerts.cap.Point.Builder builderForValue) {
  438. if (pointBuilder_ == null) {
  439. ensurePointIsMutable();
  440. point_.add(builderForValue.build());
  441. onChanged();
  442. } else {
  443. pointBuilder_.addMessage(builderForValue.build());
  444. }
  445. return this;
  446. }
  447. public Builder addPoint(
  448. int index, com.google.publicalerts.cap.Point.Builder builderForValue) {
  449. if (pointBuilder_ == null) {
  450. ensurePointIsMutable();
  451. point_.add(index, builderForValue.build());
  452. onChanged();
  453. } else {
  454. pointBuilder_.addMessage(index, builderForValue.build());
  455. }
  456. return this;
  457. }
  458. public Builder addAllPoint(
  459. java.lang.Iterable<? extends com.google.publicalerts.cap.Point> values) {
  460. if (pointBuilder_ == null) {
  461. ensurePointIsMutable();
  462. super.addAll(values, point_);
  463. onChanged();
  464. } else {
  465. pointBuilder_.addAllMessages(values);
  466. }
  467. return this;
  468. }
  469. public Builder clearPoint() {
  470. if (pointBuilder_ == null) {
  471. point_ = java.util.Collections.emptyList();
  472. bitField0_ = (bitField0_ & ~0x00000001);
  473. onChanged();
  474. } else {
  475. pointBuilder_.clear();
  476. }
  477. return this;
  478. }
  479. public Builder removePoint(int index) {
  480. if (pointBuilder_ == null) {
  481. ensurePointIsMutable();
  482. point_.remove(index);
  483. onChanged();
  484. } else {
  485. pointBuilder_.remove(index);
  486. }
  487. return this;
  488. }
  489. public com.google.publicalerts.cap.Point.Builder getPointBuilder(
  490. int index) {
  491. return getPointFieldBuilder().getBuilder(index);
  492. }
  493. public com.google.publicalerts.cap.PointOrBuilder getPointOrBuilder(
  494. int index) {
  495. if (pointBuilder_ == null) {
  496. return point_.get(index); } else {
  497. return pointBuilder_.getMessageOrBuilder(index);
  498. }
  499. }
  500. public java.util.List<? extends com.google.publicalerts.cap.PointOrBuilder>
  501. getPointOrBuilderList() {
  502. if (pointBuilder_ != null) {
  503. return pointBuilder_.getMessageOrBuilderList();
  504. } else {
  505. return java.util.Collections.unmodifiableList(point_);
  506. }
  507. }
  508. public com.google.publicalerts.cap.Point.Builder addPointBuilder() {
  509. return getPointFieldBuilder().addBuilder(
  510. com.google.publicalerts.cap.Point.getDefaultInstance());
  511. }
  512. public com.google.publicalerts.cap.Point.Builder addPointBuilder(
  513. int index) {
  514. return getPointFieldBuilder().addBuilder(
  515. index, com.google.publicalerts.cap.Point.getDefaultInstance());
  516. }
  517. public java.util.List<com.google.publicalerts.cap.Point.Builder>
  518. getPointBuilderList() {
  519. return getPointFieldBuilder().getBuilderList();
  520. }
  521. private com.google.protobuf.RepeatedFieldBuilder<
  522. com.google.publicalerts.cap.Point, com.google.publicalerts.cap.Point.Builder, com.google.publicalerts.cap.PointOrBuilder>
  523. getPointFieldBuilder() {
  524. if (pointBuilder_ == null) {
  525. pointBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  526. com.google.publicalerts.cap.Point, com.google.publicalerts.cap.Point.Builder, com.google.publicalerts.cap.PointOrBuilder>(
  527. point_,
  528. ((bitField0_ & 0x00000001) == 0x00000001),
  529. getParentForChildren(),
  530. isClean());
  531. point_ = null;
  532. }
  533. return pointBuilder_;
  534. }
  535. // @@protoc_insertion_point(builder_scope:publicalerts.cap.Polygon)
  536. }
  537. static {
  538. defaultInstance = new Polygon(true);
  539. defaultInstance.initFields();
  540. }
  541. // @@protoc_insertion_point(class_scope:publicalerts.cap.Polygon)
  542. }