Adding metadata support for rule entry dialog

This commit is contained in:
Eloízio Salgado committed 2017-03-02 10:18:11 -03:00
1 parent bec8f21c0a
commit 2333276e96
5 files changed
+163 -54

No files matched your search

@@ -160,6 +160,22 @@ export class SeriesMetadata extends Metadata {
return this._instances.indexOf(instance);
}
/**
* Search the associated instances using the supplied callback as criteria. The callback is passed
* two arguments: instance (a InstanceMetadata instance) and index (the integer
* index of the instance within its series)
* @param {function} callback The callback function which will be invoked for each instance.
* @returns {InstanceMetadata|undefined} If an instance is found based on callback criteria it
* returns a InstanceMetadata. "undefined" is returned otherwise
*/
findInstance(callback) {
if (Metadata.isValidCallback(callback)) {
return this._instances.find((instance, index) => {
return callback.call(null, instance, index);
});
}
}
/**
* Compares the current series with another one.
* @param {SeriesMetadata} series An instance of the SeriesMetadata class.