/java/src/com/google/publicalerts/cap/Point.java
Java | 446 lines | 394 code | 43 blank | 9 comment | 56 complexity | 3d4e4f3323381625e53434881c8dd376 MD5 | raw file
Possible License(s): Apache-2.0
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- package com.google.publicalerts.cap;
- public final class Point extends
- com.google.protobuf.GeneratedMessage
- implements PointOrBuilder {
- // Use Point.newBuilder() to construct.
- private Point(Builder builder) {
- super(builder);
- }
- private Point(boolean noInit) {}
-
- private static final Point defaultInstance;
- public static Point getDefaultInstance() {
- return defaultInstance;
- }
-
- public Point getDefaultInstanceForType() {
- return defaultInstance;
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_fieldAccessorTable;
- }
-
- private int bitField0_;
- // required double latitude = 1;
- public static final int LATITUDE_FIELD_NUMBER = 1;
- private double latitude_;
- public boolean hasLatitude() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- public double getLatitude() {
- return latitude_;
- }
-
- // required double longitude = 2;
- public static final int LONGITUDE_FIELD_NUMBER = 2;
- private double longitude_;
- public boolean hasLongitude() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- public double getLongitude() {
- return longitude_;
- }
-
- private void initFields() {
- latitude_ = 0D;
- longitude_ = 0D;
- }
- private byte memoizedIsInitialized = -1;
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized != -1) return isInitialized == 1;
-
- if (!hasLatitude()) {
- memoizedIsInitialized = 0;
- return false;
- }
- if (!hasLongitude()) {
- memoizedIsInitialized = 0;
- return false;
- }
- memoizedIsInitialized = 1;
- return true;
- }
-
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getSerializedSize();
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeDouble(1, latitude_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeDouble(2, longitude_);
- }
- getUnknownFields().writeTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public int getSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- size += com.google.protobuf.CodedOutputStream
- .computeDoubleSize(1, latitude_);
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- size += com.google.protobuf.CodedOutputStream
- .computeDoubleSize(2, longitude_);
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSerializedSize = size;
- return size;
- }
-
- private static final long serialVersionUID = 0L;
- @java.lang.Override
- protected java.lang.Object writeReplace()
- throws java.io.ObjectStreamException {
- return super.writeReplace();
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof com.google.publicalerts.cap.Point)) {
- return super.equals(obj);
- }
- com.google.publicalerts.cap.Point other = (com.google.publicalerts.cap.Point) obj;
-
- boolean result = true;
- result = result && (hasLatitude() == other.hasLatitude());
- if (hasLatitude()) {
- result = result && (Double.doubleToLongBits(getLatitude()) == Double.doubleToLongBits(other.getLatitude()));
- }
- result = result && (hasLongitude() == other.hasLongitude());
- if (hasLongitude()) {
- result = result && (Double.doubleToLongBits(getLongitude()) == Double.doubleToLongBits(other.getLongitude()));
- }
- result = result &&
- getUnknownFields().equals(other.getUnknownFields());
- return result;
- }
-
- @java.lang.Override
- public int hashCode() {
- int hash = 41;
- hash = (19 * hash) + getDescriptorForType().hashCode();
- if (hasLatitude()) {
- hash = (37 * hash) + LATITUDE_FIELD_NUMBER;
- hash = (53 * hash) + hashLong(
- Double.doubleToLongBits(getLatitude()));
- }
- if (hasLongitude()) {
- hash = (37 * hash) + LONGITUDE_FIELD_NUMBER;
- hash = (53 * hash) + hashLong(
- Double.doubleToLongBits(getLongitude()));
- }
- hash = (29 * hash) + getUnknownFields().hashCode();
- return hash;
- }
-
- public static com.google.publicalerts.cap.Point parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static com.google.publicalerts.cap.Point parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static com.google.publicalerts.cap.Point parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static com.google.publicalerts.cap.Point parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
-
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(com.google.publicalerts.cap.Point prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements com.google.publicalerts.cap.PointOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Point_fieldAccessorTable;
- }
-
- // Construct using com.google.publicalerts.cap.Point.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
-
- private Builder(BuilderParent parent) {
- super(parent);
- maybeForceBuilderInitialization();
- }
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- }
- }
- private static Builder create() {
- return new Builder();
- }
-
- public Builder clear() {
- super.clear();
- latitude_ = 0D;
- bitField0_ = (bitField0_ & ~0x00000001);
- longitude_ = 0D;
- bitField0_ = (bitField0_ & ~0x00000002);
- return this;
- }
-
- public Builder clone() {
- return create().mergeFrom(buildPartial());
- }
-
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return com.google.publicalerts.cap.Point.getDescriptor();
- }
-
- public com.google.publicalerts.cap.Point getDefaultInstanceForType() {
- return com.google.publicalerts.cap.Point.getDefaultInstance();
- }
-
- public com.google.publicalerts.cap.Point build() {
- com.google.publicalerts.cap.Point result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- private com.google.publicalerts.cap.Point buildParsed()
- throws com.google.protobuf.InvalidProtocolBufferException {
- com.google.publicalerts.cap.Point result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(
- result).asInvalidProtocolBufferException();
- }
- return result;
- }
-
- public com.google.publicalerts.cap.Point buildPartial() {
- com.google.publicalerts.cap.Point result = new com.google.publicalerts.cap.Point(this);
- int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
- if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
- to_bitField0_ |= 0x00000001;
- }
- result.latitude_ = latitude_;
- if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000002;
- }
- result.longitude_ = longitude_;
- result.bitField0_ = to_bitField0_;
- onBuilt();
- return result;
- }
-
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof com.google.publicalerts.cap.Point) {
- return mergeFrom((com.google.publicalerts.cap.Point)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(com.google.publicalerts.cap.Point other) {
- if (other == com.google.publicalerts.cap.Point.getDefaultInstance()) return this;
- if (other.hasLatitude()) {
- setLatitude(other.getLatitude());
- }
- if (other.hasLongitude()) {
- setLongitude(other.getLongitude());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
-
- public final boolean isInitialized() {
- if (!hasLatitude()) {
-
- return false;
- }
- if (!hasLongitude()) {
-
- return false;
- }
- return true;
- }
-
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder(
- this.getUnknownFields());
- while (true) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- this.setUnknownFields(unknownFields.build());
- onChanged();
- return this;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.setUnknownFields(unknownFields.build());
- onChanged();
- return this;
- }
- break;
- }
- case 9: {
- bitField0_ |= 0x00000001;
- latitude_ = input.readDouble();
- break;
- }
- case 17: {
- bitField0_ |= 0x00000002;
- longitude_ = input.readDouble();
- break;
- }
- }
- }
- }
-
- private int bitField0_;
-
- // required double latitude = 1;
- private double latitude_ ;
- public boolean hasLatitude() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- public double getLatitude() {
- return latitude_;
- }
- public Builder setLatitude(double value) {
- bitField0_ |= 0x00000001;
- latitude_ = value;
- onChanged();
- return this;
- }
- public Builder clearLatitude() {
- bitField0_ = (bitField0_ & ~0x00000001);
- latitude_ = 0D;
- onChanged();
- return this;
- }
-
- // required double longitude = 2;
- private double longitude_ ;
- public boolean hasLongitude() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- public double getLongitude() {
- return longitude_;
- }
- public Builder setLongitude(double value) {
- bitField0_ |= 0x00000002;
- longitude_ = value;
- onChanged();
- return this;
- }
- public Builder clearLongitude() {
- bitField0_ = (bitField0_ & ~0x00000002);
- longitude_ = 0D;
- onChanged();
- return this;
- }
-
- // @@protoc_insertion_point(builder_scope:publicalerts.cap.Point)
- }
-
- static {
- defaultInstance = new Point(true);
- defaultInstance.initFields();
- }
-
- // @@protoc_insertion_point(class_scope:publicalerts.cap.Point)
- }