Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 86 → Rev 87

/Android Development/LATMBServer/src/org/vt/ece4564/latmb/LATMBMessage.java
0,0 → 1,65
package org.vt.ece4564.latmb;
 
import java.util.Calendar;
 
public class LATMBMessage {
private String message;
private Calendar timestamp;
private Calendar expiration;
private String username;
private String chatroom;
private double latitude;
private double longitude;
private double radius;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Calendar getTimestamp() {
return timestamp;
}
public void setTimestamp(Calendar timestamp) {
this.timestamp = timestamp;
}
public Calendar getExpiration() {
return expiration;
}
public void setExpiration(Calendar expiration) {
this.expiration = expiration;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getChatroom() {
return chatroom;
}
public void setChatroom(String chatroom) {
this.chatroom = chatroom;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
}
/Android Development/LATMBServer/src/org/vt/ece4564/latmb/LATMBProtocol.java
0,0 → 1,3046
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: LATMBProtocol.proto
 
package org.vt.ece4564.latmb;
 
public final class LATMBProtocol {
private LATMBProtocol() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface TrackingMessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required int32 id = 1;
boolean hasId();
int getId();
// required int32 type = 2;
boolean hasType();
int getType();
// repeated .org.vt.ece4564.latmb.Message message = 3;
java.util.List<org.vt.ece4564.latmb.LATMBProtocol.Message>
getMessageList();
org.vt.ece4564.latmb.LATMBProtocol.Message getMessage(int index);
int getMessageCount();
java.util.List<? extends org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder>
getMessageOrBuilderList();
org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder getMessageOrBuilder(
int index);
}
public static final class TrackingMessage extends
com.google.protobuf.GeneratedMessage
implements TrackingMessageOrBuilder {
// Use TrackingMessage.newBuilder() to construct.
private TrackingMessage(Builder builder) {
super(builder);
}
private TrackingMessage(boolean noInit) {}
private static final TrackingMessage defaultInstance;
public static TrackingMessage getDefaultInstance() {
return defaultInstance;
}
public TrackingMessage getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_TrackingMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_TrackingMessage_fieldAccessorTable;
}
private int bitField0_;
// required int32 id = 1;
public static final int ID_FIELD_NUMBER = 1;
private int id_;
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getId() {
return id_;
}
// required int32 type = 2;
public static final int TYPE_FIELD_NUMBER = 2;
private int type_;
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getType() {
return type_;
}
// repeated .org.vt.ece4564.latmb.Message message = 3;
public static final int MESSAGE_FIELD_NUMBER = 3;
private java.util.List<org.vt.ece4564.latmb.LATMBProtocol.Message> message_;
public java.util.List<org.vt.ece4564.latmb.LATMBProtocol.Message> getMessageList() {
return message_;
}
public java.util.List<? extends org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder>
getMessageOrBuilderList() {
return message_;
}
public int getMessageCount() {
return message_.size();
}
public org.vt.ece4564.latmb.LATMBProtocol.Message getMessage(int index) {
return message_.get(index);
}
public org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder getMessageOrBuilder(
int index) {
return message_.get(index);
}
private void initFields() {
id_ = 0;
type_ = 0;
message_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasId()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasType()) {
memoizedIsInitialized = 0;
return false;
}
for (int i = 0; i < getMessageCount(); i++) {
if (!getMessage(i).isInitialized()) {
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.writeInt32(1, id_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, type_);
}
for (int i = 0; i < message_.size(); i++) {
output.writeMessage(3, message_.get(i));
}
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
.computeInt32Size(1, id_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, type_);
}
for (int i = 0; i < message_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, message_.get(i));
}
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();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage 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 org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage 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(org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage 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 org.vt.ece4564.latmb.LATMBProtocol.TrackingMessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_TrackingMessage_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_TrackingMessage_fieldAccessorTable;
}
// Construct using org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getMessageFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
id_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
type_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
if (messageBuilder_ == null) {
message_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
messageBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.getDescriptor();
}
public org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage getDefaultInstanceForType() {
return org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.getDefaultInstance();
}
public org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage build() {
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage buildPartial() {
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage result = new org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.id_ = id_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.type_ = type_;
if (messageBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004)) {
message_ = java.util.Collections.unmodifiableList(message_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.message_ = message_;
} else {
result.message_ = messageBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage) {
return mergeFrom((org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage other) {
if (other == org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.getDefaultInstance()) return this;
if (other.hasId()) {
setId(other.getId());
}
if (other.hasType()) {
setType(other.getType());
}
if (messageBuilder_ == null) {
if (!other.message_.isEmpty()) {
if (message_.isEmpty()) {
message_ = other.message_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureMessageIsMutable();
message_.addAll(other.message_);
}
onChanged();
}
} else {
if (!other.message_.isEmpty()) {
if (messageBuilder_.isEmpty()) {
messageBuilder_.dispose();
messageBuilder_ = null;
message_ = other.message_;
bitField0_ = (bitField0_ & ~0x00000004);
messageBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getMessageFieldBuilder() : null;
} else {
messageBuilder_.addAllMessages(other.message_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasId()) {
return false;
}
if (!hasType()) {
return false;
}
for (int i = 0; i < getMessageCount(); i++) {
if (!getMessage(i).isInitialized()) {
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 8: {
bitField0_ |= 0x00000001;
id_ = input.readInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
type_ = input.readInt32();
break;
}
case 26: {
org.vt.ece4564.latmb.LATMBProtocol.Message.Builder subBuilder = org.vt.ece4564.latmb.LATMBProtocol.Message.newBuilder();
input.readMessage(subBuilder, extensionRegistry);
addMessage(subBuilder.buildPartial());
break;
}
}
}
}
private int bitField0_;
// required int32 id = 1;
private int id_ ;
public boolean hasId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getId() {
return id_;
}
public Builder setId(int value) {
bitField0_ |= 0x00000001;
id_ = value;
onChanged();
return this;
}
public Builder clearId() {
bitField0_ = (bitField0_ & ~0x00000001);
id_ = 0;
onChanged();
return this;
}
// required int32 type = 2;
private int type_ ;
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getType() {
return type_;
}
public Builder setType(int value) {
bitField0_ |= 0x00000002;
type_ = value;
onChanged();
return this;
}
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000002);
type_ = 0;
onChanged();
return this;
}
// repeated .org.vt.ece4564.latmb.Message message = 3;
private java.util.List<org.vt.ece4564.latmb.LATMBProtocol.Message> message_ =
java.util.Collections.emptyList();
private void ensureMessageIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
message_ = new java.util.ArrayList<org.vt.ece4564.latmb.LATMBProtocol.Message>(message_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.Message, org.vt.ece4564.latmb.LATMBProtocol.Message.Builder, org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder> messageBuilder_;
public java.util.List<org.vt.ece4564.latmb.LATMBProtocol.Message> getMessageList() {
if (messageBuilder_ == null) {
return java.util.Collections.unmodifiableList(message_);
} else {
return messageBuilder_.getMessageList();
}
}
public int getMessageCount() {
if (messageBuilder_ == null) {
return message_.size();
} else {
return messageBuilder_.getCount();
}
}
public org.vt.ece4564.latmb.LATMBProtocol.Message getMessage(int index) {
if (messageBuilder_ == null) {
return message_.get(index);
} else {
return messageBuilder_.getMessage(index);
}
}
public Builder setMessage(
int index, org.vt.ece4564.latmb.LATMBProtocol.Message value) {
if (messageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMessageIsMutable();
message_.set(index, value);
onChanged();
} else {
messageBuilder_.setMessage(index, value);
}
return this;
}
public Builder setMessage(
int index, org.vt.ece4564.latmb.LATMBProtocol.Message.Builder builderForValue) {
if (messageBuilder_ == null) {
ensureMessageIsMutable();
message_.set(index, builderForValue.build());
onChanged();
} else {
messageBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
public Builder addMessage(org.vt.ece4564.latmb.LATMBProtocol.Message value) {
if (messageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMessageIsMutable();
message_.add(value);
onChanged();
} else {
messageBuilder_.addMessage(value);
}
return this;
}
public Builder addMessage(
int index, org.vt.ece4564.latmb.LATMBProtocol.Message value) {
if (messageBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMessageIsMutable();
message_.add(index, value);
onChanged();
} else {
messageBuilder_.addMessage(index, value);
}
return this;
}
public Builder addMessage(
org.vt.ece4564.latmb.LATMBProtocol.Message.Builder builderForValue) {
if (messageBuilder_ == null) {
ensureMessageIsMutable();
message_.add(builderForValue.build());
onChanged();
} else {
messageBuilder_.addMessage(builderForValue.build());
}
return this;
}
public Builder addMessage(
int index, org.vt.ece4564.latmb.LATMBProtocol.Message.Builder builderForValue) {
if (messageBuilder_ == null) {
ensureMessageIsMutable();
message_.add(index, builderForValue.build());
onChanged();
} else {
messageBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
public Builder addAllMessage(
java.lang.Iterable<? extends org.vt.ece4564.latmb.LATMBProtocol.Message> values) {
if (messageBuilder_ == null) {
ensureMessageIsMutable();
super.addAll(values, message_);
onChanged();
} else {
messageBuilder_.addAllMessages(values);
}
return this;
}
public Builder clearMessage() {
if (messageBuilder_ == null) {
message_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
messageBuilder_.clear();
}
return this;
}
public Builder removeMessage(int index) {
if (messageBuilder_ == null) {
ensureMessageIsMutable();
message_.remove(index);
onChanged();
} else {
messageBuilder_.remove(index);
}
return this;
}
public org.vt.ece4564.latmb.LATMBProtocol.Message.Builder getMessageBuilder(
int index) {
return getMessageFieldBuilder().getBuilder(index);
}
public org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder getMessageOrBuilder(
int index) {
if (messageBuilder_ == null) {
return message_.get(index); } else {
return messageBuilder_.getMessageOrBuilder(index);
}
}
public java.util.List<? extends org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder>
getMessageOrBuilderList() {
if (messageBuilder_ != null) {
return messageBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(message_);
}
}
public org.vt.ece4564.latmb.LATMBProtocol.Message.Builder addMessageBuilder() {
return getMessageFieldBuilder().addBuilder(
org.vt.ece4564.latmb.LATMBProtocol.Message.getDefaultInstance());
}
public org.vt.ece4564.latmb.LATMBProtocol.Message.Builder addMessageBuilder(
int index) {
return getMessageFieldBuilder().addBuilder(
index, org.vt.ece4564.latmb.LATMBProtocol.Message.getDefaultInstance());
}
public java.util.List<org.vt.ece4564.latmb.LATMBProtocol.Message.Builder>
getMessageBuilderList() {
return getMessageFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.Message, org.vt.ece4564.latmb.LATMBProtocol.Message.Builder, org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder>
getMessageFieldBuilder() {
if (messageBuilder_ == null) {
messageBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.Message, org.vt.ece4564.latmb.LATMBProtocol.Message.Builder, org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder>(
message_,
((bitField0_ & 0x00000004) == 0x00000004),
getParentForChildren(),
isClean());
message_ = null;
}
return messageBuilder_;
}
// @@protoc_insertion_point(builder_scope:org.vt.ece4564.latmb.TrackingMessage)
}
static {
defaultInstance = new TrackingMessage(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:org.vt.ece4564.latmb.TrackingMessage)
}
public interface MessageOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string message = 1;
boolean hasMessage();
String getMessage();
// required .org.vt.ece4564.latmb.DateTime timestamp = 2;
boolean hasTimestamp();
org.vt.ece4564.latmb.LATMBProtocol.DateTime getTimestamp();
org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder getTimestampOrBuilder();
// required .org.vt.ece4564.latmb.DateTime expiration = 3;
boolean hasExpiration();
org.vt.ece4564.latmb.LATMBProtocol.DateTime getExpiration();
org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder getExpirationOrBuilder();
// optional string username = 4;
boolean hasUsername();
String getUsername();
// optional string chatroom = 5;
boolean hasChatroom();
String getChatroom();
// optional .org.vt.ece4564.latmb.Position coordinates = 6;
boolean hasCoordinates();
org.vt.ece4564.latmb.LATMBProtocol.Position getCoordinates();
org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder getCoordinatesOrBuilder();
// optional double radius = 7;
boolean hasRadius();
double getRadius();
}
public static final class Message extends
com.google.protobuf.GeneratedMessage
implements MessageOrBuilder {
// Use Message.newBuilder() to construct.
private Message(Builder builder) {
super(builder);
}
private Message(boolean noInit) {}
private static final Message defaultInstance;
public static Message getDefaultInstance() {
return defaultInstance;
}
public Message getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Message_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Message_fieldAccessorTable;
}
private int bitField0_;
// required string message = 1;
public static final int MESSAGE_FIELD_NUMBER = 1;
private java.lang.Object message_;
public boolean hasMessage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public String getMessage() {
java.lang.Object ref = message_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
message_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required .org.vt.ece4564.latmb.DateTime timestamp = 2;
public static final int TIMESTAMP_FIELD_NUMBER = 2;
private org.vt.ece4564.latmb.LATMBProtocol.DateTime timestamp_;
public boolean hasTimestamp() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime getTimestamp() {
return timestamp_;
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder getTimestampOrBuilder() {
return timestamp_;
}
// required .org.vt.ece4564.latmb.DateTime expiration = 3;
public static final int EXPIRATION_FIELD_NUMBER = 3;
private org.vt.ece4564.latmb.LATMBProtocol.DateTime expiration_;
public boolean hasExpiration() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime getExpiration() {
return expiration_;
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder getExpirationOrBuilder() {
return expiration_;
}
// optional string username = 4;
public static final int USERNAME_FIELD_NUMBER = 4;
private java.lang.Object username_;
public boolean hasUsername() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public String getUsername() {
java.lang.Object ref = username_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
username_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getUsernameBytes() {
java.lang.Object ref = username_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
username_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional string chatroom = 5;
public static final int CHATROOM_FIELD_NUMBER = 5;
private java.lang.Object chatroom_;
public boolean hasChatroom() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public String getChatroom() {
java.lang.Object ref = chatroom_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
chatroom_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getChatroomBytes() {
java.lang.Object ref = chatroom_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
chatroom_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .org.vt.ece4564.latmb.Position coordinates = 6;
public static final int COORDINATES_FIELD_NUMBER = 6;
private org.vt.ece4564.latmb.LATMBProtocol.Position coordinates_;
public boolean hasCoordinates() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public org.vt.ece4564.latmb.LATMBProtocol.Position getCoordinates() {
return coordinates_;
}
public org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder getCoordinatesOrBuilder() {
return coordinates_;
}
// optional double radius = 7;
public static final int RADIUS_FIELD_NUMBER = 7;
private double radius_;
public boolean hasRadius() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public double getRadius() {
return radius_;
}
private void initFields() {
message_ = "";
timestamp_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
expiration_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
username_ = "";
chatroom_ = "";
coordinates_ = org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance();
radius_ = 0D;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasMessage()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasTimestamp()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasExpiration()) {
memoizedIsInitialized = 0;
return false;
}
if (!getTimestamp().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
if (!getExpiration().isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
if (hasCoordinates()) {
if (!getCoordinates().isInitialized()) {
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.writeBytes(1, getMessageBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, timestamp_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeMessage(3, expiration_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(4, getUsernameBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(5, getChatroomBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeMessage(6, coordinates_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeDouble(7, radius_);
}
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
.computeBytesSize(1, getMessageBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, timestamp_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, expiration_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, getUsernameBytes());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getChatroomBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, coordinates_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(7, radius_);
}
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();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message 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 org.vt.ece4564.latmb.LATMBProtocol.Message parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Message 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(org.vt.ece4564.latmb.LATMBProtocol.Message 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 org.vt.ece4564.latmb.LATMBProtocol.MessageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Message_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Message_fieldAccessorTable;
}
// Construct using org.vt.ece4564.latmb.LATMBProtocol.Message.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getTimestampFieldBuilder();
getExpirationFieldBuilder();
getCoordinatesFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
message_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
if (timestampBuilder_ == null) {
timestamp_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
} else {
timestampBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
if (expirationBuilder_ == null) {
expiration_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
} else {
expirationBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
username_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
chatroom_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
if (coordinatesBuilder_ == null) {
coordinates_ = org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance();
} else {
coordinatesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
radius_ = 0D;
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.vt.ece4564.latmb.LATMBProtocol.Message.getDescriptor();
}
public org.vt.ece4564.latmb.LATMBProtocol.Message getDefaultInstanceForType() {
return org.vt.ece4564.latmb.LATMBProtocol.Message.getDefaultInstance();
}
public org.vt.ece4564.latmb.LATMBProtocol.Message build() {
org.vt.ece4564.latmb.LATMBProtocol.Message result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.vt.ece4564.latmb.LATMBProtocol.Message buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.vt.ece4564.latmb.LATMBProtocol.Message result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.vt.ece4564.latmb.LATMBProtocol.Message buildPartial() {
org.vt.ece4564.latmb.LATMBProtocol.Message result = new org.vt.ece4564.latmb.LATMBProtocol.Message(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.message_ = message_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
if (timestampBuilder_ == null) {
result.timestamp_ = timestamp_;
} else {
result.timestamp_ = timestampBuilder_.build();
}
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
if (expirationBuilder_ == null) {
result.expiration_ = expiration_;
} else {
result.expiration_ = expirationBuilder_.build();
}
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.username_ = username_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.chatroom_ = chatroom_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
if (coordinatesBuilder_ == null) {
result.coordinates_ = coordinates_;
} else {
result.coordinates_ = coordinatesBuilder_.build();
}
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.radius_ = radius_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.vt.ece4564.latmb.LATMBProtocol.Message) {
return mergeFrom((org.vt.ece4564.latmb.LATMBProtocol.Message)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.vt.ece4564.latmb.LATMBProtocol.Message other) {
if (other == org.vt.ece4564.latmb.LATMBProtocol.Message.getDefaultInstance()) return this;
if (other.hasMessage()) {
setMessage(other.getMessage());
}
if (other.hasTimestamp()) {
mergeTimestamp(other.getTimestamp());
}
if (other.hasExpiration()) {
mergeExpiration(other.getExpiration());
}
if (other.hasUsername()) {
setUsername(other.getUsername());
}
if (other.hasChatroom()) {
setChatroom(other.getChatroom());
}
if (other.hasCoordinates()) {
mergeCoordinates(other.getCoordinates());
}
if (other.hasRadius()) {
setRadius(other.getRadius());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasMessage()) {
return false;
}
if (!hasTimestamp()) {
return false;
}
if (!hasExpiration()) {
return false;
}
if (!getTimestamp().isInitialized()) {
return false;
}
if (!getExpiration().isInitialized()) {
return false;
}
if (hasCoordinates()) {
if (!getCoordinates().isInitialized()) {
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 10: {
bitField0_ |= 0x00000001;
message_ = input.readBytes();
break;
}
case 18: {
org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder subBuilder = org.vt.ece4564.latmb.LATMBProtocol.DateTime.newBuilder();
if (hasTimestamp()) {
subBuilder.mergeFrom(getTimestamp());
}
input.readMessage(subBuilder, extensionRegistry);
setTimestamp(subBuilder.buildPartial());
break;
}
case 26: {
org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder subBuilder = org.vt.ece4564.latmb.LATMBProtocol.DateTime.newBuilder();
if (hasExpiration()) {
subBuilder.mergeFrom(getExpiration());
}
input.readMessage(subBuilder, extensionRegistry);
setExpiration(subBuilder.buildPartial());
break;
}
case 34: {
bitField0_ |= 0x00000008;
username_ = input.readBytes();
break;
}
case 42: {
bitField0_ |= 0x00000010;
chatroom_ = input.readBytes();
break;
}
case 50: {
org.vt.ece4564.latmb.LATMBProtocol.Position.Builder subBuilder = org.vt.ece4564.latmb.LATMBProtocol.Position.newBuilder();
if (hasCoordinates()) {
subBuilder.mergeFrom(getCoordinates());
}
input.readMessage(subBuilder, extensionRegistry);
setCoordinates(subBuilder.buildPartial());
break;
}
case 57: {
bitField0_ |= 0x00000040;
radius_ = input.readDouble();
break;
}
}
}
}
private int bitField0_;
// required string message = 1;
private java.lang.Object message_ = "";
public boolean hasMessage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public String getMessage() {
java.lang.Object ref = message_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
message_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setMessage(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
message_ = value;
onChanged();
return this;
}
public Builder clearMessage() {
bitField0_ = (bitField0_ & ~0x00000001);
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
void setMessage(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000001;
message_ = value;
onChanged();
}
// required .org.vt.ece4564.latmb.DateTime timestamp = 2;
private org.vt.ece4564.latmb.LATMBProtocol.DateTime timestamp_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.DateTime, org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder, org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder> timestampBuilder_;
public boolean hasTimestamp() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime getTimestamp() {
if (timestampBuilder_ == null) {
return timestamp_;
} else {
return timestampBuilder_.getMessage();
}
}
public Builder setTimestamp(org.vt.ece4564.latmb.LATMBProtocol.DateTime value) {
if (timestampBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
timestamp_ = value;
onChanged();
} else {
timestampBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
return this;
}
public Builder setTimestamp(
org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder builderForValue) {
if (timestampBuilder_ == null) {
timestamp_ = builderForValue.build();
onChanged();
} else {
timestampBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
return this;
}
public Builder mergeTimestamp(org.vt.ece4564.latmb.LATMBProtocol.DateTime value) {
if (timestampBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002) &&
timestamp_ != org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance()) {
timestamp_ =
org.vt.ece4564.latmb.LATMBProtocol.DateTime.newBuilder(timestamp_).mergeFrom(value).buildPartial();
} else {
timestamp_ = value;
}
onChanged();
} else {
timestampBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000002;
return this;
}
public Builder clearTimestamp() {
if (timestampBuilder_ == null) {
timestamp_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
onChanged();
} else {
timestampBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder getTimestampBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getTimestampFieldBuilder().getBuilder();
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder getTimestampOrBuilder() {
if (timestampBuilder_ != null) {
return timestampBuilder_.getMessageOrBuilder();
} else {
return timestamp_;
}
}
private com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.DateTime, org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder, org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder>
getTimestampFieldBuilder() {
if (timestampBuilder_ == null) {
timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.DateTime, org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder, org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder>(
timestamp_,
getParentForChildren(),
isClean());
timestamp_ = null;
}
return timestampBuilder_;
}
// required .org.vt.ece4564.latmb.DateTime expiration = 3;
private org.vt.ece4564.latmb.LATMBProtocol.DateTime expiration_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.DateTime, org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder, org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder> expirationBuilder_;
public boolean hasExpiration() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime getExpiration() {
if (expirationBuilder_ == null) {
return expiration_;
} else {
return expirationBuilder_.getMessage();
}
}
public Builder setExpiration(org.vt.ece4564.latmb.LATMBProtocol.DateTime value) {
if (expirationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
expiration_ = value;
onChanged();
} else {
expirationBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
return this;
}
public Builder setExpiration(
org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder builderForValue) {
if (expirationBuilder_ == null) {
expiration_ = builderForValue.build();
onChanged();
} else {
expirationBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
return this;
}
public Builder mergeExpiration(org.vt.ece4564.latmb.LATMBProtocol.DateTime value) {
if (expirationBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004) &&
expiration_ != org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance()) {
expiration_ =
org.vt.ece4564.latmb.LATMBProtocol.DateTime.newBuilder(expiration_).mergeFrom(value).buildPartial();
} else {
expiration_ = value;
}
onChanged();
} else {
expirationBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000004;
return this;
}
public Builder clearExpiration() {
if (expirationBuilder_ == null) {
expiration_ = org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
onChanged();
} else {
expirationBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder getExpirationBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getExpirationFieldBuilder().getBuilder();
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder getExpirationOrBuilder() {
if (expirationBuilder_ != null) {
return expirationBuilder_.getMessageOrBuilder();
} else {
return expiration_;
}
}
private com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.DateTime, org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder, org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder>
getExpirationFieldBuilder() {
if (expirationBuilder_ == null) {
expirationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.DateTime, org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder, org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder>(
expiration_,
getParentForChildren(),
isClean());
expiration_ = null;
}
return expirationBuilder_;
}
// optional string username = 4;
private java.lang.Object username_ = "";
public boolean hasUsername() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public String getUsername() {
java.lang.Object ref = username_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
username_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setUsername(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
username_ = value;
onChanged();
return this;
}
public Builder clearUsername() {
bitField0_ = (bitField0_ & ~0x00000008);
username_ = getDefaultInstance().getUsername();
onChanged();
return this;
}
void setUsername(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000008;
username_ = value;
onChanged();
}
// optional string chatroom = 5;
private java.lang.Object chatroom_ = "";
public boolean hasChatroom() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public String getChatroom() {
java.lang.Object ref = chatroom_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
chatroom_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setChatroom(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
chatroom_ = value;
onChanged();
return this;
}
public Builder clearChatroom() {
bitField0_ = (bitField0_ & ~0x00000010);
chatroom_ = getDefaultInstance().getChatroom();
onChanged();
return this;
}
void setChatroom(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000010;
chatroom_ = value;
onChanged();
}
// optional .org.vt.ece4564.latmb.Position coordinates = 6;
private org.vt.ece4564.latmb.LATMBProtocol.Position coordinates_ = org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.Position, org.vt.ece4564.latmb.LATMBProtocol.Position.Builder, org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder> coordinatesBuilder_;
public boolean hasCoordinates() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public org.vt.ece4564.latmb.LATMBProtocol.Position getCoordinates() {
if (coordinatesBuilder_ == null) {
return coordinates_;
} else {
return coordinatesBuilder_.getMessage();
}
}
public Builder setCoordinates(org.vt.ece4564.latmb.LATMBProtocol.Position value) {
if (coordinatesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
coordinates_ = value;
onChanged();
} else {
coordinatesBuilder_.setMessage(value);
}
bitField0_ |= 0x00000020;
return this;
}
public Builder setCoordinates(
org.vt.ece4564.latmb.LATMBProtocol.Position.Builder builderForValue) {
if (coordinatesBuilder_ == null) {
coordinates_ = builderForValue.build();
onChanged();
} else {
coordinatesBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000020;
return this;
}
public Builder mergeCoordinates(org.vt.ece4564.latmb.LATMBProtocol.Position value) {
if (coordinatesBuilder_ == null) {
if (((bitField0_ & 0x00000020) == 0x00000020) &&
coordinates_ != org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance()) {
coordinates_ =
org.vt.ece4564.latmb.LATMBProtocol.Position.newBuilder(coordinates_).mergeFrom(value).buildPartial();
} else {
coordinates_ = value;
}
onChanged();
} else {
coordinatesBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000020;
return this;
}
public Builder clearCoordinates() {
if (coordinatesBuilder_ == null) {
coordinates_ = org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance();
onChanged();
} else {
coordinatesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
public org.vt.ece4564.latmb.LATMBProtocol.Position.Builder getCoordinatesBuilder() {
bitField0_ |= 0x00000020;
onChanged();
return getCoordinatesFieldBuilder().getBuilder();
}
public org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder getCoordinatesOrBuilder() {
if (coordinatesBuilder_ != null) {
return coordinatesBuilder_.getMessageOrBuilder();
} else {
return coordinates_;
}
}
private com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.Position, org.vt.ece4564.latmb.LATMBProtocol.Position.Builder, org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder>
getCoordinatesFieldBuilder() {
if (coordinatesBuilder_ == null) {
coordinatesBuilder_ = new com.google.protobuf.SingleFieldBuilder<
org.vt.ece4564.latmb.LATMBProtocol.Position, org.vt.ece4564.latmb.LATMBProtocol.Position.Builder, org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder>(
coordinates_,
getParentForChildren(),
isClean());
coordinates_ = null;
}
return coordinatesBuilder_;
}
// optional double radius = 7;
private double radius_ ;
public boolean hasRadius() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public double getRadius() {
return radius_;
}
public Builder setRadius(double value) {
bitField0_ |= 0x00000040;
radius_ = value;
onChanged();
return this;
}
public Builder clearRadius() {
bitField0_ = (bitField0_ & ~0x00000040);
radius_ = 0D;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:org.vt.ece4564.latmb.Message)
}
static {
defaultInstance = new Message(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:org.vt.ece4564.latmb.Message)
}
public interface PositionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required double latitude = 1;
boolean hasLatitude();
double getLatitude();
// required double longitude = 2;
boolean hasLongitude();
double getLongitude();
// required double accuracy = 3;
boolean hasAccuracy();
double getAccuracy();
}
public static final class Position extends
com.google.protobuf.GeneratedMessage
implements PositionOrBuilder {
// Use Position.newBuilder() to construct.
private Position(Builder builder) {
super(builder);
}
private Position(boolean noInit) {}
private static final Position defaultInstance;
public static Position getDefaultInstance() {
return defaultInstance;
}
public Position getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Position_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Position_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_;
}
// required double accuracy = 3;
public static final int ACCURACY_FIELD_NUMBER = 3;
private double accuracy_;
public boolean hasAccuracy() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public double getAccuracy() {
return accuracy_;
}
private void initFields() {
latitude_ = 0D;
longitude_ = 0D;
accuracy_ = 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;
}
if (!hasAccuracy()) {
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_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeDouble(3, accuracy_);
}
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_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(3, accuracy_);
}
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();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position 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 org.vt.ece4564.latmb.LATMBProtocol.Position parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.Position 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(org.vt.ece4564.latmb.LATMBProtocol.Position 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 org.vt.ece4564.latmb.LATMBProtocol.PositionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Position_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_Position_fieldAccessorTable;
}
// Construct using org.vt.ece4564.latmb.LATMBProtocol.Position.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);
accuracy_ = 0D;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.vt.ece4564.latmb.LATMBProtocol.Position.getDescriptor();
}
public org.vt.ece4564.latmb.LATMBProtocol.Position getDefaultInstanceForType() {
return org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance();
}
public org.vt.ece4564.latmb.LATMBProtocol.Position build() {
org.vt.ece4564.latmb.LATMBProtocol.Position result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.vt.ece4564.latmb.LATMBProtocol.Position buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.vt.ece4564.latmb.LATMBProtocol.Position result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.vt.ece4564.latmb.LATMBProtocol.Position buildPartial() {
org.vt.ece4564.latmb.LATMBProtocol.Position result = new org.vt.ece4564.latmb.LATMBProtocol.Position(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_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.accuracy_ = accuracy_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.vt.ece4564.latmb.LATMBProtocol.Position) {
return mergeFrom((org.vt.ece4564.latmb.LATMBProtocol.Position)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.vt.ece4564.latmb.LATMBProtocol.Position other) {
if (other == org.vt.ece4564.latmb.LATMBProtocol.Position.getDefaultInstance()) return this;
if (other.hasLatitude()) {
setLatitude(other.getLatitude());
}
if (other.hasLongitude()) {
setLongitude(other.getLongitude());
}
if (other.hasAccuracy()) {
setAccuracy(other.getAccuracy());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasLatitude()) {
return false;
}
if (!hasLongitude()) {
return false;
}
if (!hasAccuracy()) {
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;
}
case 25: {
bitField0_ |= 0x00000004;
accuracy_ = 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;
}
// required double accuracy = 3;
private double accuracy_ ;
public boolean hasAccuracy() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public double getAccuracy() {
return accuracy_;
}
public Builder setAccuracy(double value) {
bitField0_ |= 0x00000004;
accuracy_ = value;
onChanged();
return this;
}
public Builder clearAccuracy() {
bitField0_ = (bitField0_ & ~0x00000004);
accuracy_ = 0D;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:org.vt.ece4564.latmb.Position)
}
static {
defaultInstance = new Position(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:org.vt.ece4564.latmb.Position)
}
public interface DateTimeOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required int32 year = 1;
boolean hasYear();
int getYear();
// required int32 month = 2;
boolean hasMonth();
int getMonth();
// required int32 day = 3;
boolean hasDay();
int getDay();
// required int32 hour = 4;
boolean hasHour();
int getHour();
// required int32 minute = 5;
boolean hasMinute();
int getMinute();
// required int32 second = 6;
boolean hasSecond();
int getSecond();
}
public static final class DateTime extends
com.google.protobuf.GeneratedMessage
implements DateTimeOrBuilder {
// Use DateTime.newBuilder() to construct.
private DateTime(Builder builder) {
super(builder);
}
private DateTime(boolean noInit) {}
private static final DateTime defaultInstance;
public static DateTime getDefaultInstance() {
return defaultInstance;
}
public DateTime getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_DateTime_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_DateTime_fieldAccessorTable;
}
private int bitField0_;
// required int32 year = 1;
public static final int YEAR_FIELD_NUMBER = 1;
private int year_;
public boolean hasYear() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getYear() {
return year_;
}
// required int32 month = 2;
public static final int MONTH_FIELD_NUMBER = 2;
private int month_;
public boolean hasMonth() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getMonth() {
return month_;
}
// required int32 day = 3;
public static final int DAY_FIELD_NUMBER = 3;
private int day_;
public boolean hasDay() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getDay() {
return day_;
}
// required int32 hour = 4;
public static final int HOUR_FIELD_NUMBER = 4;
private int hour_;
public boolean hasHour() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public int getHour() {
return hour_;
}
// required int32 minute = 5;
public static final int MINUTE_FIELD_NUMBER = 5;
private int minute_;
public boolean hasMinute() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public int getMinute() {
return minute_;
}
// required int32 second = 6;
public static final int SECOND_FIELD_NUMBER = 6;
private int second_;
public boolean hasSecond() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public int getSecond() {
return second_;
}
private void initFields() {
year_ = 0;
month_ = 0;
day_ = 0;
hour_ = 0;
minute_ = 0;
second_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasYear()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMonth()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasDay()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasHour()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMinute()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSecond()) {
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.writeInt32(1, year_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, month_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt32(3, day_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt32(4, hour_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeInt32(5, minute_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeInt32(6, second_);
}
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
.computeInt32Size(1, year_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, month_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, day_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, hour_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, minute_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, second_);
}
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();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime 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 org.vt.ece4564.latmb.LATMBProtocol.DateTime parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static org.vt.ece4564.latmb.LATMBProtocol.DateTime 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(org.vt.ece4564.latmb.LATMBProtocol.DateTime 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 org.vt.ece4564.latmb.LATMBProtocol.DateTimeOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_DateTime_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.vt.ece4564.latmb.LATMBProtocol.internal_static_org_vt_ece4564_latmb_DateTime_fieldAccessorTable;
}
// Construct using org.vt.ece4564.latmb.LATMBProtocol.DateTime.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();
year_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
month_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
day_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
hour_ = 0;
bitField0_ = (bitField0_ & ~0x00000008);
minute_ = 0;
bitField0_ = (bitField0_ & ~0x00000010);
second_ = 0;
bitField0_ = (bitField0_ & ~0x00000020);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDescriptor();
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime getDefaultInstanceForType() {
return org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance();
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime build() {
org.vt.ece4564.latmb.LATMBProtocol.DateTime result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private org.vt.ece4564.latmb.LATMBProtocol.DateTime buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
org.vt.ece4564.latmb.LATMBProtocol.DateTime result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public org.vt.ece4564.latmb.LATMBProtocol.DateTime buildPartial() {
org.vt.ece4564.latmb.LATMBProtocol.DateTime result = new org.vt.ece4564.latmb.LATMBProtocol.DateTime(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.year_ = year_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.month_ = month_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.day_ = day_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.hour_ = hour_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.minute_ = minute_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.second_ = second_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.vt.ece4564.latmb.LATMBProtocol.DateTime) {
return mergeFrom((org.vt.ece4564.latmb.LATMBProtocol.DateTime)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.vt.ece4564.latmb.LATMBProtocol.DateTime other) {
if (other == org.vt.ece4564.latmb.LATMBProtocol.DateTime.getDefaultInstance()) return this;
if (other.hasYear()) {
setYear(other.getYear());
}
if (other.hasMonth()) {
setMonth(other.getMonth());
}
if (other.hasDay()) {
setDay(other.getDay());
}
if (other.hasHour()) {
setHour(other.getHour());
}
if (other.hasMinute()) {
setMinute(other.getMinute());
}
if (other.hasSecond()) {
setSecond(other.getSecond());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasYear()) {
return false;
}
if (!hasMonth()) {
return false;
}
if (!hasDay()) {
return false;
}
if (!hasHour()) {
return false;
}
if (!hasMinute()) {
return false;
}
if (!hasSecond()) {
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 8: {
bitField0_ |= 0x00000001;
year_ = input.readInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
month_ = input.readInt32();
break;
}
case 24: {
bitField0_ |= 0x00000004;
day_ = input.readInt32();
break;
}
case 32: {
bitField0_ |= 0x00000008;
hour_ = input.readInt32();
break;
}
case 40: {
bitField0_ |= 0x00000010;
minute_ = input.readInt32();
break;
}
case 48: {
bitField0_ |= 0x00000020;
second_ = input.readInt32();
break;
}
}
}
}
private int bitField0_;
// required int32 year = 1;
private int year_ ;
public boolean hasYear() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public int getYear() {
return year_;
}
public Builder setYear(int value) {
bitField0_ |= 0x00000001;
year_ = value;
onChanged();
return this;
}
public Builder clearYear() {
bitField0_ = (bitField0_ & ~0x00000001);
year_ = 0;
onChanged();
return this;
}
// required int32 month = 2;
private int month_ ;
public boolean hasMonth() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public int getMonth() {
return month_;
}
public Builder setMonth(int value) {
bitField0_ |= 0x00000002;
month_ = value;
onChanged();
return this;
}
public Builder clearMonth() {
bitField0_ = (bitField0_ & ~0x00000002);
month_ = 0;
onChanged();
return this;
}
// required int32 day = 3;
private int day_ ;
public boolean hasDay() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getDay() {
return day_;
}
public Builder setDay(int value) {
bitField0_ |= 0x00000004;
day_ = value;
onChanged();
return this;
}
public Builder clearDay() {
bitField0_ = (bitField0_ & ~0x00000004);
day_ = 0;
onChanged();
return this;
}
// required int32 hour = 4;
private int hour_ ;
public boolean hasHour() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public int getHour() {
return hour_;
}
public Builder setHour(int value) {
bitField0_ |= 0x00000008;
hour_ = value;
onChanged();
return this;
}
public Builder clearHour() {
bitField0_ = (bitField0_ & ~0x00000008);
hour_ = 0;
onChanged();
return this;
}
// required int32 minute = 5;
private int minute_ ;
public boolean hasMinute() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public int getMinute() {
return minute_;
}
public Builder setMinute(int value) {
bitField0_ |= 0x00000010;
minute_ = value;
onChanged();
return this;
}
public Builder clearMinute() {
bitField0_ = (bitField0_ & ~0x00000010);
minute_ = 0;
onChanged();
return this;
}
// required int32 second = 6;
private int second_ ;
public boolean hasSecond() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public int getSecond() {
return second_;
}
public Builder setSecond(int value) {
bitField0_ |= 0x00000020;
second_ = value;
onChanged();
return this;
}
public Builder clearSecond() {
bitField0_ = (bitField0_ & ~0x00000020);
second_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:org.vt.ece4564.latmb.DateTime)
}
static {
defaultInstance = new DateTime(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:org.vt.ece4564.latmb.DateTime)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_org_vt_ece4564_latmb_TrackingMessage_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_vt_ece4564_latmb_TrackingMessage_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_org_vt_ece4564_latmb_Message_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_vt_ece4564_latmb_Message_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_org_vt_ece4564_latmb_Position_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_vt_ece4564_latmb_Position_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_org_vt_ece4564_latmb_DateTime_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_vt_ece4564_latmb_DateTime_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\023LATMBProtocol.proto\022\024org.vt.ece4564.la" +
"tmb\"[\n\017TrackingMessage\022\n\n\002id\030\001 \002(\005\022\014\n\004ty" +
"pe\030\002 \002(\005\022.\n\007message\030\003 \003(\0132\035.org.vt.ece45" +
"64.latmb.Message\"\352\001\n\007Message\022\017\n\007message\030" +
"\001 \002(\t\0221\n\ttimestamp\030\002 \002(\0132\036.org.vt.ece456" +
"4.latmb.DateTime\0222\n\nexpiration\030\003 \002(\0132\036.o" +
"rg.vt.ece4564.latmb.DateTime\022\020\n\010username" +
"\030\004 \001(\t\022\020\n\010chatroom\030\005 \001(\t\0223\n\013coordinates\030" +
"\006 \001(\0132\036.org.vt.ece4564.latmb.Position\022\016\n" +
"\006radius\030\007 \001(\001\"A\n\010Position\022\020\n\010latitude\030\001 ",
"\002(\001\022\021\n\tlongitude\030\002 \002(\001\022\020\n\010accuracy\030\003 \002(\001" +
"\"b\n\010DateTime\022\014\n\004year\030\001 \002(\005\022\r\n\005month\030\002 \002(" +
"\005\022\013\n\003day\030\003 \002(\005\022\014\n\004hour\030\004 \002(\005\022\016\n\006minute\030\005" +
" \002(\005\022\016\n\006second\030\006 \002(\005"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_org_vt_ece4564_latmb_TrackingMessage_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_org_vt_ece4564_latmb_TrackingMessage_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_vt_ece4564_latmb_TrackingMessage_descriptor,
new java.lang.String[] { "Id", "Type", "Message", },
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.class,
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.Builder.class);
internal_static_org_vt_ece4564_latmb_Message_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_org_vt_ece4564_latmb_Message_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_vt_ece4564_latmb_Message_descriptor,
new java.lang.String[] { "Message", "Timestamp", "Expiration", "Username", "Chatroom", "Coordinates", "Radius", },
org.vt.ece4564.latmb.LATMBProtocol.Message.class,
org.vt.ece4564.latmb.LATMBProtocol.Message.Builder.class);
internal_static_org_vt_ece4564_latmb_Position_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_org_vt_ece4564_latmb_Position_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_vt_ece4564_latmb_Position_descriptor,
new java.lang.String[] { "Latitude", "Longitude", "Accuracy", },
org.vt.ece4564.latmb.LATMBProtocol.Position.class,
org.vt.ece4564.latmb.LATMBProtocol.Position.Builder.class);
internal_static_org_vt_ece4564_latmb_DateTime_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_org_vt_ece4564_latmb_DateTime_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_vt_ece4564_latmb_DateTime_descriptor,
new java.lang.String[] { "Year", "Month", "Day", "Hour", "Minute", "Second", },
org.vt.ece4564.latmb.LATMBProtocol.DateTime.class,
org.vt.ece4564.latmb.LATMBProtocol.DateTime.Builder.class);
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}
/Android Development/LATMBServer/src/org/vt/ece4564/latmb/LATMBProtocol.proto
0,0 → 1,32
package org.vt.ece4564.latmb;
 
message TrackingMessage {
required int32 id = 1;
required int32 type = 2;
repeated Message message = 3;
}
 
message Message {
required string message = 1;
required DateTime timestamp = 2;
required DateTime expiration = 3;
optional string username = 4;
optional string chatroom = 5;
optional Position coordinates = 6;
optional double radius = 7;
}
 
message Position {
required double latitude = 1;
required double longitude = 2;
required double accuracy = 3;
}
 
message DateTime {
required int32 year = 1;
required int32 month = 2;
required int32 day = 3;
required int32 hour = 4;
required int32 minute = 5;
required int32 second = 6;
}
/Android Development/LATMBServer/src/org/vt/ece4564/latmb/LATMBServer.java
0,0 → 1,49
/**************************************************************************
* Copyright 2011 Jules White
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package org.vt.ece4564.latmb;
 
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
 
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
 
/**
* Simple SSL chat server modified from {@link TelnetServer}.
*
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
*/
public class LATMBServer {
 
public static void main(String[] args) throws Exception {
// Configure the server.
ServerBootstrap bootstrap = new ServerBootstrap(
new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool()));
 
// Configure the pipeline factory.
bootstrap.setPipelineFactory(new LATMBServerPipelineFactory());
 
// Bind and start to accept incoming connections.
bootstrap.bind(new InetSocketAddress(8080));
 
}
}
/Android Development/LATMBServer/src/org/vt/ece4564/latmb/LATMBServerHandler.java
0,0 → 1,484
/**************************************************************************
* Copyright 2011 Jules White
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package org.vt.ece4564.latmb;
 
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
 
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.channel.group.ChannelGroup;
import org.jboss.netty.channel.group.DefaultChannelGroup;
import org.vt.ece4564.latmb.LATMBProtocol.DateTime;
import org.vt.ece4564.latmb.LATMBProtocol.Message;
import org.vt.ece4564.latmb.LATMBProtocol.Position;
import org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage;
import org.vt.ece4564.latmb.LATMBProtocol.Message.Builder;
 
/**
* Handles a server-side channel.
*
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev: 2121 $, $Date: 2010-02-02 09:38:07 +0900 (Tue, 02 Feb 2010) $
*/
public class LATMBServerHandler extends SimpleChannelUpstreamHandler {
 
private static final Logger logger = Logger
.getLogger(LATMBServerHandler.class.getName());
 
static final ChannelGroup channels = new DefaultChannelGroup();
// Map of channels connected to chatrooms
static final Map<String, ChannelGroup> chatrooms = Collections.synchronizedMap(new HashMap<String, ChannelGroup>());
// Map of messages for each chatroom
static final Map<String, List<LATMBMessage>> messages = Collections.synchronizedMap(new HashMap<String, List<LATMBMessage>>());
// Map of channels and their locations
static final Map<Channel, Point2D.Double> gpsChannels = Collections.synchronizedMap(new HashMap<Channel, Point2D.Double>());
// List storing messages for GPS lookup
static final List<LATMBMessage> gpsMessages = new LinkedList<LATMBMessage>();
private Thread checkThread_;
 
@Override
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
throws Exception {
if (e instanceof ChannelStateEvent) {
logger.info(e.toString());
}
super.handleUpstream(ctx, e);
}
 
public void broadcast(TrackingMessage msg) {
for (Channel c : channels) {
c.write(msg);
}
}
 
private synchronized void checkRecords() {
if (checkThread_ == null) {
checkThread_ = new Thread(new Runnable() {
 
@Override
public void run() {
while (true) {
try {
Thread.currentThread().sleep(5000);
// Removes empty chatrooms
for (String str : chatrooms.keySet()) {
if (chatrooms.get(str).size() == 0) {
chatrooms.remove(str);
}
}
// Removes expired messages and empty lists from chatrooms
Calendar c = Calendar.getInstance();
for (String str : messages.keySet()) {
if (messages.get(str).size() == 0) {
messages.remove(str);
} else {
List<LATMBMessage> toRemove = new ArrayList<LATMBMessage>();
for (LATMBMessage message : messages.get(str)) {
if (c.after(message.getExpiration())) {
toRemove.add(message);
}
}
for (LATMBMessage message : toRemove) {
messages.get(str).remove(message);
}
}
}
// Remove expired messages from list of messages with GPS locations
List<LATMBMessage> toRemove = new ArrayList<LATMBMessage>();
for (LATMBMessage msg : gpsMessages) {
if (c.after(msg.getExpiration())) {
toRemove.add(msg);
}
}
for (LATMBMessage message : toRemove) {
gpsMessages.remove(message);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
checkThread_.start();
}
}
@Override
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception {
 
channels.add(e.getChannel());
// Start the thread to check for expired entries
checkRecords();
}
 
@Override
public void channelDisconnected(ChannelHandlerContext ctx,
ChannelStateEvent e) throws Exception {
// Unregister the channel from the global channel list
// so the channel does not receive messages anymore.
channels.remove(e.getChannel());
// Remove channel from list of GPS channels as well
gpsChannels.remove(e.getChannel());
}
 
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
TrackingMessage tmsg = (TrackingMessage) e.getMessage();
switch (tmsg.getType()) {
case 0: // Initial connection from a client
System.out.println("Initial Request Message Recieved");
if (tmsg.getMessage(0).hasChatroom()) {
String chatroom = tmsg.getMessage(0).getChatroom();
// If chatroom exists, send back all messages from that chatroom
if (messages.containsKey(chatroom)) {
e.getChannel().write(aggregateMessagesFromChatrooms(chatroom));
}
// Add the current channel to the list of channels for that chatroom
if (chatrooms.containsKey(chatroom)) {
chatrooms.get(chatroom).add(e.getChannel());
} else {
ChannelGroup channels = new DefaultChannelGroup();
channels.add(e.getChannel());
chatrooms.put(chatroom, channels);
}
} else if (tmsg.getMessage(0).hasCoordinates()) {
double lat = tmsg.getMessage(0).getCoordinates().getLatitude();
double lon = tmsg.getMessage(0).getCoordinates().getLongitude();
double radius = tmsg.getMessage(0).getRadius();
// Get messages that are within radius of channel
e.getChannel().write(aggregateMessagesFromGPS(lat, lon, radius));
// Save channel with its location
Point2D.Double pt = new Point2D.Double(lat, lon);
gpsChannels.put(e.getChannel(), pt);
}
break;
case 1: // Saves message and broadcast it
System.out.println("New Update Message Recieved");
LATMBMessage msg = serializeFromProtoBuffer(tmsg);
if (tmsg.getMessage(0).hasChatroom()) {
String chatroom = tmsg.getMessage(0).getChatroom();
// Send message to all channels connected to the chatroom
if (messages.containsKey(chatroom)) {
messages.get(chatroom).add(msg);
for (Channel c : chatrooms.get(chatroom)) {
c.write(tmsg);
}
} else {
List<LATMBMessage> newList = new LinkedList<LATMBMessage>();
newList.add(msg);
messages.put(chatroom, newList);
for (Channel c : chatrooms.get(chatroom)) {
c.write(tmsg);
}
}
} else if (tmsg.getMessage(0).hasCoordinates()) {
// Otherwise search for channels that are within radius
for (Channel ch : gpsChannels.keySet()) {
double lat = gpsChannels.get(ch).getX();
double lon = gpsChannels.get(ch).getY();
double radius = msg.getRadius();
// Send message to each channel within the radius
if (getCoordinateDistance(lat, lon, msg.getLatitude(), msg.getLongitude()) <= radius) {
ch.write(tmsg);
}
}
// Save message to list of GPS associated messages
gpsMessages.add(msg);
}
break;
}
}
 
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
logger.log(Level.WARNING, "Unexpected exception from downstream.",
e.getCause());
e.getChannel().close();
}
// Returns a TrackingMessage of all messages that are within radius of specified point
private TrackingMessage aggregateMessagesFromGPS (double lat, double lon, double radius) {
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.Builder msg = TrackingMessage.newBuilder()
.setId(0).setType(1);
for (LATMBMessage entry : gpsMessages) {
if (getCoordinateDistance(lat, lon, entry.getLatitude(), entry.getLongitude()) <= radius) {
Calendar c = entry.getTimestamp();
DateTime timestamp = DateTime.newBuilder()
.setYear(c.get(Calendar.YEAR))
.setMonth(c.get(Calendar.MONTH))
.setDay(c.get(Calendar.DAY_OF_MONTH))
.setHour(c.get(Calendar.HOUR_OF_DAY))
.setMinute(c.get(Calendar.MINUTE))
.setSecond(c.get(Calendar.SECOND))
.build();
c = entry.getExpiration();
DateTime expiration = DateTime.newBuilder()
.setYear(c.get(Calendar.YEAR))
.setMonth(c.get(Calendar.MONTH))
.setDay(c.get(Calendar.DAY_OF_MONTH))
.setHour(c.get(Calendar.HOUR_OF_DAY))
.setMinute(c.get(Calendar.MINUTE))
.setSecond(c.get(Calendar.SECOND))
.build();
Builder message = Message.newBuilder()
.setMessage(entry.getMessage())
.setTimestamp(timestamp)
.setExpiration(expiration);
if (entry.getUsername() != null) {
message.setUsername(entry.getUsername());
}
if (entry.getChatroom() != null) {
message.setChatroom(entry.getChatroom());
} else if (entry.getLatitude() != 0 && entry.getLongitude() != 0){
Position pos = Position.newBuilder()
.setLatitude(entry.getLatitude())
.setLongitude(entry.getLongitude())
.setAccuracy(0)
.build();
message.setCoordinates(pos);
}
if (entry.getRadius() != 0) {
message.setRadius(entry.getRadius());
}
msg.addMessage(message);
}
}
if (msg.isInitialized()) {
return msg.build();
} else {
return null;
}
}
// Returns a TrackingMessage containing all the messages from a chatroom
private TrackingMessage aggregateMessagesFromChatrooms (String chatroom) {
List<LATMBMessage> list = messages.get(chatroom);
org.vt.ece4564.latmb.LATMBProtocol.TrackingMessage.Builder msg = TrackingMessage.newBuilder()
// Type 1 == New Message
.setId(0).setType(1);
for (LATMBMessage entry : list) {
Calendar c = entry.getTimestamp();
DateTime timestamp = DateTime.newBuilder()
.setYear(c.get(Calendar.YEAR))
.setMonth(c.get(Calendar.MONTH))
.setDay(c.get(Calendar.DAY_OF_MONTH))
.setHour(c.get(Calendar.HOUR_OF_DAY))
.setMinute(c.get(Calendar.MINUTE))
.setSecond(c.get(Calendar.SECOND))
.build();
c = entry.getExpiration();
DateTime expiration = DateTime.newBuilder()
.setYear(c.get(Calendar.YEAR))
.setMonth(c.get(Calendar.MONTH))
.setDay(c.get(Calendar.DAY_OF_MONTH))
.setHour(c.get(Calendar.HOUR_OF_DAY))
.setMinute(c.get(Calendar.MINUTE))
.setSecond(c.get(Calendar.SECOND))
.build();
Builder message = Message.newBuilder()
.setMessage(entry.getMessage())
.setTimestamp(timestamp)
.setExpiration(expiration);
if (entry.getUsername() != null) {
message.setUsername(entry.getUsername());
}
if (entry.getChatroom() != null) {
message.setChatroom(entry.getChatroom());
} else if (entry.getLatitude() != 0 && entry.getLongitude() != 0){
Position pos = Position.newBuilder()
.setLatitude(entry.getLatitude())
.setLongitude(entry.getLongitude())
.setAccuracy(0)
.build();
message.setCoordinates(pos);
}
if (entry.getRadius() != 0) {
message.setRadius(entry.getRadius());
}
msg.addMessage(message);
}
if (msg.isInitialized()) {
return msg.build();
} else {
return null;
}
}
 
// Returns a TrackingMessage created from the passed LATMBMessage
private TrackingMessage serializeToProtoBuffer (LATMBMessage entry) {
Calendar c = entry.getTimestamp();
DateTime timestamp = DateTime.newBuilder()
.setYear(c.get(Calendar.YEAR))
.setMonth(c.get(Calendar.MONTH))
.setDay(c.get(Calendar.DAY_OF_MONTH))
.setHour(c.get(Calendar.HOUR_OF_DAY))
.setMinute(c.get(Calendar.MINUTE))
.setSecond(c.get(Calendar.SECOND))
.build();
c = entry.getExpiration();
DateTime expiration = DateTime.newBuilder()
.setYear(c.get(Calendar.YEAR))
.setMonth(c.get(Calendar.MONTH))
.setDay(c.get(Calendar.DAY_OF_MONTH))
.setHour(c.get(Calendar.HOUR_OF_DAY))
.setMinute(c.get(Calendar.MINUTE))
.setSecond(c.get(Calendar.SECOND))
.build();
Builder message = Message.newBuilder()
.setMessage(entry.getMessage())
.setTimestamp(timestamp)
.setExpiration(expiration);
if (entry.getUsername() != null) {
message.setUsername(entry.getUsername());
}
if (entry.getChatroom() != null) {
message.setChatroom(entry.getChatroom());
} else if (entry.getLatitude() != 0 && entry.getLongitude() != 0){
Position pos = Position.newBuilder()
.setLatitude(entry.getLatitude())
.setLongitude(entry.getLongitude())
.setAccuracy(0)
.build();
message.setCoordinates(pos);
}
if (entry.getRadius() != 0) {
message.setRadius(entry.getRadius());
}
TrackingMessage msg = TrackingMessage.newBuilder()
// Type 1 == New Message
.setId(0).setType(1)
.addMessage(message)
.build();
return msg;
}
// Returns a LATMBMessage from the passed TrackingMessage
private LATMBMessage serializeFromProtoBuffer(TrackingMessage message) {
Message msg = message.getMessage(0);
LATMBMessage newEntry = new LATMBMessage();
newEntry.setMessage(msg.getMessage());
DateTime timestamp = msg.getTimestamp();
DateTime expiration = msg.getExpiration();
Calendar time = new GregorianCalendar();
time.set(timestamp.getYear(), timestamp.getMonth(), timestamp.getDay(),
timestamp.getHour(), timestamp.getMinute(), timestamp.getSecond());
newEntry.setTimestamp(time);
Calendar exp = new GregorianCalendar();
exp.set(expiration.getYear(), expiration.getMonth(), expiration.getDay(),
expiration.getHour(), expiration.getMinute(), expiration.getSecond());
newEntry.setExpiration(exp);
if (msg.hasUsername()) {
newEntry.setUsername(msg.getUsername());
} else {
newEntry.setUsername("Anonymous");
}
if (msg.hasChatroom()) {
newEntry.setChatroom(msg.getChatroom());
}
if (msg.hasCoordinates()) {
Position coord = msg.getCoordinates();
newEntry.setLatitude(coord.getLatitude());
newEntry.setLongitude(coord.getLongitude());
}
if (msg.hasRadius()) {
newEntry.setRadius(msg.getRadius());
}
return newEntry;
}
// Returns the distance (in km) between the two specified points
private double getCoordinateDistance(double startLat, double startLong, double endLat, double endLong) {
double d2r = Math.PI / 180;
 
double dlong = (endLong - startLong) * d2r;
double dlat = (endLat - startLat) * d2r;
double a =
Math.pow(Math.sin(dlat / 2.0), 2)
+ Math.cos(startLat * d2r)
* Math.cos(endLat * d2r)
* Math.pow(Math.sin(dlong / 2.0), 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double d = 6367 * c;
 
return d;
}
}
/Android Development/LATMBServer/src/org/vt/ece4564/latmb/LATMBServerPipelineFactory.java
0,0 → 1,64
/**************************************************************************
* Copyright 2011 Jules White
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package org.vt.ece4564.latmb;
 
import static org.jboss.netty.channel.Channels.*;
 
import javax.net.ssl.SSLEngine;
 
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;
import org.jboss.netty.handler.codec.protobuf.ProtobufDecoder;
import org.jboss.netty.handler.codec.protobuf.ProtobufEncoder;
import org.jboss.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;
import org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;
import org.jboss.netty.handler.ssl.SslHandler;
 
/**
* Creates a newly configured {@link ChannelPipeline} for a new channel.
*
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
*
* @version $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
*
*/
public class LATMBServerPipelineFactory implements ChannelPipelineFactory {
 
private boolean useSSL_ = false;
 
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
 
 
pipeline.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
pipeline.addLast("protobufDecoder", new ProtobufDecoder(
LATMBProtocol.TrackingMessage.getDefaultInstance()));
 
pipeline.addLast("frameEncoder",
new ProtobufVarint32LengthFieldPrepender());
pipeline.addLast("protobufEncoder", new ProtobufEncoder());
 
// and then business logic.
pipeline.addLast("handler", new LATMBServerHandler());
 
return pipeline;
}
}
/Android Development/LATMBServer/src/org/vt/ece4564/latmb/build_protocol.sh
0,0 → 1,0
protoc LATMBProtocol.proto --java_out=../../../../