1 if (Garmin == undefined) var Garmin = {}; 2 /** 3 * Copyright � 2007 Garmin Ltd. or its subsidiaries. 4 * 5 * Licensed under the Apache License, Version 2.0 (the 'License') 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an 'AS IS' BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 * @fileoverview Garmin.Measurement - A datastructure designed to contain a single data measurement. 18 * 19 * @author Bobby Yang bobby.yang.at.garmin.com 20 * @version 1.0 21 */ 22 /**Represent a real measurement. 23 * @class Garmin.Measurement 24 * @constructor 25 * @param value - value of the measurement 26 * @param context - the context of the measurement (feet, seconds, etc...) 27 */ 28 Garmin.Measurement = function(value, context){}; 29 Garmin.Measurement = Class.create(); 30 Garmin.Measurement.prototype = { 31 32 initialize: function(value, context) { 33 this.value = value; 34 this.context = context; 35 }, 36 37 getContext: function() { 38 return this.context; 39 }, 40 41 setContext: function(context) { 42 this.context = context; 43 }, 44 45 getValue: function() { 46 return this.value; 47 }, 48 49 setValue: function(value) { 50 this.value = value; 51 }, 52 53 printMe: function(tabs) { 54 var output = ""; 55 output += tabs + " [Measurement]\n"; 56 output += tabs + " value: " + this.value + '\n'; 57 //output += tabs + " context: " + this.context + '\n'; 58 return output; 59 }, 60 61 toString: function() { 62 return this.value + " " + this.context; 63 } 64 }; 65