1 /*global $k*/ 2 3 /** 4 * @class Represents a type of attributes 5 * @extends $k.PropertyType 6 **/ 7 $k.AttributeType = function() { }; 8 9 /** 10 * Returns the semantic element with an attribute of this type with the specified value, or undefined if there is either no such attribute or more than one 11 * 12 * @function 13 * @param {string} value The value to search for 14 * @param {string} [language] Language of the value. If not defined, the current language will be used. 15 * Ignored if the attribute is not translated 16 * @returns {$k.SemanticElement} 17 * @throws {$k.exception.InvalidValue} If the value is not in the range of allowed values of the attribute 18 **/ 19 $k.AttributeType.prototype.elementAtValue = function(value, language) { }; 20 21 /** 22 * Returns all semantic elements with attributes of this types with the specified value 23 * 24 * @function 25 * @param {string} value The value to search for 26 * @param {string} [language] Language of the value. If not defined, the current language will be used. 27 * Ignored if the attribute is not translated 28 * @returns {$k.SemanticElement[]} 29 * @throws {$k.exception.InvalidValue} If the value is not in the range of allowed values of the attribute 30 **/ 31 $k.AttributeType.prototype.elementsAtValue = function(value, language) { }; 32 33 /** 34 * True if the attributes have translated values 35 * 36 * @function 37 * @returns {boolean} 38 **/ 39 $k.AttributeType.prototype.hasTranslatedValues = function() { }; 40 41 /** 42 * Returns the possible translated languages as 3-letter codes (ISO639 2b). 43 * Empty if the attribute is not translated 44 * 45 * @function 46 * @returns {string[]} 47 **/ 48 $k.AttributeType.prototype.translatedLanguages = function() { }; 49 50 /** 51 * Returns the range of the values of the attributes 52 * 53 * @function 54 * @returns {$k.ValueRange} 55 **/ 56 $k.AttributeType.prototype.valueRange = function() { }; 57 58