/**
 * @fileoverview
 * @enhanceable
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!

goog.provide('proto.transit_realtime.Position');

goog.require('jspb.Message');


/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.transit_realtime.Position = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, 6, null, null);
};
goog.inherits(proto.transit_realtime.Position, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  proto.transit_realtime.Position.displayName = 'proto.transit_realtime.Position';
}


if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto suitable for use in Soy templates.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
 *     for transitional soy proto support: http://goto/soy-param-migration
 * @return {!Object}
 */
proto.transit_realtime.Position.prototype.toObject = function(opt_includeInstance) {
  return proto.transit_realtime.Position.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Whether to include the JSPB
 *     instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.transit_realtime.Position} msg The msg instance to transform.
 * @return {!Object}
 */
proto.transit_realtime.Position.toObject = function(includeInstance, msg) {
  var f, obj = {
    latitude: +jspb.Message.getField(msg, 1),
    longitude: +jspb.Message.getField(msg, 2),
    bearing: jspb.Message.getOptionalFloatingPointField(msg, 3),
    odometer: jspb.Message.getOptionalFloatingPointField(msg, 4),
    speed: jspb.Message.getOptionalFloatingPointField(msg, 5)
  };

  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
      proto.transit_realtime.Position.extensions, proto.transit_realtime.Position.prototype.getExtension,
      includeInstance);
  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Creates a deep clone of this proto. No data is shared with the original.
 * @return {!proto.transit_realtime.Position} The clone.
 */
proto.transit_realtime.Position.prototype.cloneMessage = function() {
  return /** @type {!proto.transit_realtime.Position} */ (jspb.Message.cloneMessage(this));
};


/**
 * required float latitude = 1;
 * @return {number}
 */
proto.transit_realtime.Position.prototype.getLatitude = function() {
  return /** @type {number} */ (!this.hasLatitude() ? 0.0 : +jspb.Message.getField(this, 1));
};


/** @param {number|undefined} value  */
proto.transit_realtime.Position.prototype.setLatitude = function(value) {
  jspb.Message.setField(this, 1, value);
};


proto.transit_realtime.Position.prototype.clearLatitude = function() {
  jspb.Message.setField(this, 1, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.transit_realtime.Position.prototype.hasLatitude = function() {
  return jspb.Message.getField(this, 1) != null;
};


/**
 * required float longitude = 2;
 * @return {number}
 */
proto.transit_realtime.Position.prototype.getLongitude = function() {
  return /** @type {number} */ (!this.hasLongitude() ? 0.0 : +jspb.Message.getField(this, 2));
};


/** @param {number|undefined} value  */
proto.transit_realtime.Position.prototype.setLongitude = function(value) {
  jspb.Message.setField(this, 2, value);
};


proto.transit_realtime.Position.prototype.clearLongitude = function() {
  jspb.Message.setField(this, 2, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.transit_realtime.Position.prototype.hasLongitude = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * optional float bearing = 3;
 * @return {number}
 */
proto.transit_realtime.Position.prototype.getBearing = function() {
  return /** @type {number} */ (!this.hasBearing() ? 0.0 : +jspb.Message.getField(this, 3));
};


/** @param {number?|undefined} value  */
proto.transit_realtime.Position.prototype.setBearing = function(value) {
  jspb.Message.setField(this, 3, value);
};


proto.transit_realtime.Position.prototype.clearBearing = function() {
  jspb.Message.setField(this, 3, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.transit_realtime.Position.prototype.hasBearing = function() {
  return jspb.Message.getField(this, 3) != null;
};


/**
 * optional double odometer = 4;
 * @return {number}
 */
proto.transit_realtime.Position.prototype.getOdometer = function() {
  return /** @type {number} */ (!this.hasOdometer() ? 0.0 : +jspb.Message.getField(this, 4));
};


/** @param {number?|undefined} value  */
proto.transit_realtime.Position.prototype.setOdometer = function(value) {
  jspb.Message.setField(this, 4, value);
};


proto.transit_realtime.Position.prototype.clearOdometer = function() {
  jspb.Message.setField(this, 4, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.transit_realtime.Position.prototype.hasOdometer = function() {
  return jspb.Message.getField(this, 4) != null;
};


/**
 * optional float speed = 5;
 * @return {number}
 */
proto.transit_realtime.Position.prototype.getSpeed = function() {
  return /** @type {number} */ (!this.hasSpeed() ? 0.0 : +jspb.Message.getField(this, 5));
};


/** @param {number?|undefined} value  */
proto.transit_realtime.Position.prototype.setSpeed = function(value) {
  jspb.Message.setField(this, 5, value);
};


proto.transit_realtime.Position.prototype.clearSpeed = function() {
  jspb.Message.setField(this, 5, undefined);
};


/**
 * Returns whether this field is set.
 * @return{!boolean}
 */
proto.transit_realtime.Position.prototype.hasSpeed = function() {
  return jspb.Message.getField(this, 5) != null;
};



/**
 * The extensions registered with this message class. This is a map of
 * extension field number to fieldInfo object.
 *
 * For example:
 *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
 *
 * fieldName contains the JsCompiler renamed field name property so that it
 * works in OPTIMIZED mode.
 *
 * @type {!Object.<number, jspb.ExtensionFieldInfo>}
 */
proto.transit_realtime.Position.extensions = {};

