|
| 1 | +/* This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | + * |
| 5 | + * Software distributed under the License is distributed on an "AS IS" basis, |
| 6 | + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 7 | + * for the specific language governing rights and limitations under the License. |
| 8 | + * |
| 9 | + * The Initial Developer is Terravolv, Inc. Portions created by the Initial |
| 10 | + * Developer are Copyright (C) 2014-2015 the Initial Developer. All Rights Reserved. |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
| 14 | + * @date May 28, 2015 |
| 15 | + * @public |
| 16 | + */ |
| 17 | + |
| 18 | +var ScalarParamter = function() { |
| 19 | + |
| 20 | + // Privates |
| 21 | + var _propertyName = null; |
| 22 | + var _constantValue = null; |
| 23 | + var _mappingFunction = null; |
| 24 | + var _constant = true; |
| 25 | + |
| 26 | + // Getters and Setters |
| 27 | + this.isConstant = function() { |
| 28 | + return _constant; |
| 29 | + } |
| 30 | + |
| 31 | + this.setConstant = function(c) { |
| 32 | + _constant = c; |
| 33 | + } |
| 34 | + |
| 35 | + this.getConstantValue = function() { |
| 36 | + return _constantValue; |
| 37 | + } |
| 38 | + |
| 39 | + this.setConstantValue = function(cv) { |
| 40 | + _constantValue = cv; |
| 41 | + _constant = false; |
| 42 | + } |
| 43 | + |
| 44 | + this.getMappedValue = function() { |
| 45 | + return this.getConstantValue(); |
| 46 | + } |
| 47 | + |
| 48 | + this.getMappingFunction = function() { |
| 49 | + return _mappingFunction; |
| 50 | + } |
| 51 | + |
| 52 | + this.setMappingFunction = function (mf) { |
| 53 | + _mappingFunction = mf; |
| 54 | + _constant = false; |
| 55 | + } |
| 56 | + |
| 57 | + this.getPropertyName = function () { |
| 58 | + return _propertyName; |
| 59 | + } |
| 60 | + |
| 61 | + this.setPropertyName = function(pn) { |
| 62 | + _propertyName = pn; |
| 63 | + _constant = false; |
| 64 | + } |
| 65 | + |
| 66 | + return this; |
| 67 | + |
| 68 | +} // ScalarParameter |
0 commit comments