The X Toolkit API

X.indexer

/**
* Create an indexer which maps indices to objects while dropping duplicates.
*
* @constructor
* @extends X.base
*/
var i = new X.indexer();
/**
* The className of this class.
*
* @type {string}
* @protected
*/
i._classname = $_CLASSNAME;
/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/
i._dirty = $_DIRTY;
/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/
i._id = $_ID;
/**
* The indices of the objects.
*
* @type {!Array}
* @protected
*/
i._indices = $_INDICES;
/**
* The mapping between indices and objects.
*
* @type {!Object}
* @protected
*/
i._map = $_MAP;
/**
* The unique objects.
*
* @type {!Array}
* @protected
*/
i._unique = $_UNIQUE;
/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/
var _classname = i.classname;
/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/
var _id = i.id;
/**
* Add an object if it has not been added.
*
* @param {!Object} object The object to add.
* @return The index of the object after it was added.
* @throws {Error} An exception if the object is invalid.
*/
var add = i.add($OBJECT);
/**
* Get the unique objects.
*
* @return {!Array}
*/
var unique = i.unique();


CONSTRUCTORS
X.indexer

PROPERTIES
_classname
_dirty
_id
_indices
_map
_unique

GETTERS/SETTERS
classname
id

FUNCTIONS
add
unique

STATIC



SOURCECODE