Use extends, super and proper constructor comments for format/filter/

This commit is contained in:
ahocevar
2018-07-17 18:36:26 +02:00
parent 414d1556a7
commit fd962caa1c
21 changed files with 155 additions and 229 deletions
+5 -8
View File
@@ -1,27 +1,24 @@
/** /**
* @module ol/format/filter/And * @module ol/format/filter/And
*/ */
import {inherits} from '../../util.js';
import LogicalNary from '../filter/LogicalNary.js'; import LogicalNary from '../filter/LogicalNary.js';
/** /**
* @classdesc * @classdesc
* Represents a logical `<And>` operator between two or more filter conditions. * Represents a logical `<And>` operator between two or more filter conditions.
* *
* @constructor
* @abstract * @abstract
* @param {...module:ol/format/filter/Filter} conditions Conditions.
* @extends {module:ol/format/filter/LogicalNary}
*/ */
class And { class And extends LogicalNary {
/**
* @param {...module:ol/format/filter/Filter} conditions Conditions.
*/
constructor(conditions) { constructor(conditions) {
const params = ['And'].concat(Array.prototype.slice.call(arguments)); const params = ['And'].concat(Array.prototype.slice.call(arguments));
LogicalNary.apply(this, params); super(...params);
} }
} }
inherits(And, LogicalNary);
export default And; export default And;
+8 -11
View File
@@ -1,7 +1,6 @@
/** /**
* @module ol/format/filter/Bbox * @module ol/format/filter/Bbox
*/ */
import {inherits} from '../../util.js';
import Filter from '../filter/Filter.js'; import Filter from '../filter/Filter.js';
/** /**
@@ -9,19 +8,19 @@ import Filter from '../filter/Filter.js';
* Represents a `<BBOX>` operator to test whether a geometry-valued property * Represents a `<BBOX>` operator to test whether a geometry-valued property
* intersects a fixed bounding box * intersects a fixed bounding box
* *
* @constructor
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/extent~Extent} extent Extent.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @extends {module:ol/format/filter/Filter}
* @api * @api
*/ */
class Bbox { class Bbox extends Filter {
/**
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/extent~Extent} extent Extent.
* @param {string=} opt_srsName SRS name. No srsName attribute will be set
* on geometries when this is not provided.
*/
constructor(geometryName, extent, opt_srsName) { constructor(geometryName, extent, opt_srsName) {
Filter.call(this, 'BBOX'); super('BBOX');
/** /**
* @type {!string} * @type {!string}
@@ -41,6 +40,4 @@ class Bbox {
} }
inherits(Bbox, Filter);
export default Bbox; export default Bbox;
+6 -9
View File
@@ -1,7 +1,6 @@
/** /**
* @module ol/format/filter/Comparison * @module ol/format/filter/Comparison
*/ */
import {inherits} from '../../util.js';
import Filter from '../filter/Filter.js'; import Filter from '../filter/Filter.js';
/** /**
@@ -9,17 +8,17 @@ import Filter from '../filter/Filter.js';
* Abstract class; normally only used for creating subclasses and not instantiated in apps. * Abstract class; normally only used for creating subclasses and not instantiated in apps.
* Base class for WFS GetFeature property comparison filters. * Base class for WFS GetFeature property comparison filters.
* *
* @constructor
* @abstract * @abstract
* @param {!string} tagName The XML tag name for this filter.
* @param {!string} propertyName Name of the context property to compare.
* @extends {module:ol/format/filter/Filter}
*/ */
class Comparison { class Comparison extends Filter {
/**
* @param {!string} tagName The XML tag name for this filter.
* @param {!string} propertyName Name of the context property to compare.
*/
constructor(tagName, propertyName) { constructor(tagName, propertyName) {
Filter.call(this, tagName); super(tagName);
/** /**
* @type {!string} * @type {!string}
@@ -29,6 +28,4 @@ class Comparison {
} }
inherits(Comparison, Filter);
export default Comparison; export default Comparison;
+8 -11
View File
@@ -1,7 +1,6 @@
/** /**
* @module ol/format/filter/ComparisonBinary * @module ol/format/filter/ComparisonBinary
*/ */
import {inherits} from '../../util.js';
import Comparison from '../filter/Comparison.js'; import Comparison from '../filter/Comparison.js';
/** /**
@@ -9,19 +8,19 @@ import Comparison from '../filter/Comparison.js';
* Abstract class; normally only used for creating subclasses and not instantiated in apps. * Abstract class; normally only used for creating subclasses and not instantiated in apps.
* Base class for WFS GetFeature property binary comparison filters. * Base class for WFS GetFeature property binary comparison filters.
* *
* @constructor
* @abstract * @abstract
* @param {!string} tagName The XML tag name for this filter.
* @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive?
* @extends {module:ol/format/filter/Comparison}
*/ */
class ComparisonBinary { class ComparisonBinary extends Comparison {
/**
* @param {!string} tagName The XML tag name for this filter.
* @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive?
*/
constructor(tagName, propertyName, expression, opt_matchCase) { constructor(tagName, propertyName, expression, opt_matchCase) {
Comparison.call(this, tagName, propertyName); super(tagName, propertyName);
/** /**
* @type {!(string|number)} * @type {!(string|number)}
@@ -36,6 +35,4 @@ class ComparisonBinary {
} }
inherits(ComparisonBinary, Comparison);
export default ComparisonBinary; export default ComparisonBinary;
+9 -13
View File
@@ -1,32 +1,28 @@
/** /**
* @module ol/format/filter/Contains * @module ol/format/filter/Contains
*/ */
import {inherits} from '../../util.js';
import Spatial from '../filter/Spatial.js'; import Spatial from '../filter/Spatial.js';
/** /**
* @classdesc * @classdesc
* Represents a `<Contains>` operator to test whether a geometry-valued property * Represents a `<Contains>` operator to test whether a geometry-valued property
* contains a given geometry. * contains a given geometry.
*
* @constructor
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/geom/Geometry} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @extends {module:ol/format/filter/Spatial}
* @api
*/ */
class Contains { class Contains extends Spatial {
/**
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/geom/Geometry} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @api
*/
constructor(geometryName, geometry, opt_srsName) { constructor(geometryName, geometry, opt_srsName) {
Spatial.call(this, 'Contains', geometryName, geometry, opt_srsName); super('Contains', geometryName, geometry, opt_srsName);
} }
} }
inherits(Contains, Spatial);
export default Contains; export default Contains;
+8 -12
View File
@@ -1,24 +1,22 @@
/** /**
* @module ol/format/filter/During * @module ol/format/filter/During
*/ */
import {inherits} from '../../util.js';
import Comparison from '../filter/Comparison.js'; import Comparison from '../filter/Comparison.js';
/** /**
* @classdesc * @classdesc
* Represents a `<During>` comparison operator. * Represents a `<During>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!string} begin The begin date in ISO-8601 format.
* @param {!string} end The end date in ISO-8601 format.
* @extends {module:ol/format/filter/Comparison}
* @api
*/ */
class During { class During extends Comparison {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!string} begin The begin date in ISO-8601 format.
* @param {!string} end The end date in ISO-8601 format.
* @api
*/
constructor(propertyName, begin, end) { constructor(propertyName, begin, end) {
Comparison.call(this, 'During', propertyName); super('During', propertyName);
/** /**
* @type {!string} * @type {!string}
@@ -33,6 +31,4 @@ class During {
} }
inherits(During, Comparison);
export default During; export default During;
+8 -12
View File
@@ -1,28 +1,24 @@
/** /**
* @module ol/format/filter/EqualTo * @module ol/format/filter/EqualTo
*/ */
import {inherits} from '../../util.js';
import ComparisonBinary from '../filter/ComparisonBinary.js'; import ComparisonBinary from '../filter/ComparisonBinary.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsEqualTo>` comparison operator. * Represents a `<PropertyIsEqualTo>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive?
* @extends {module:ol/format/filter/ComparisonBinary}
* @api
*/ */
class EqualTo { class EqualTo extends ComparisonBinary {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive?
* @api
*/
constructor(propertyName, expression, opt_matchCase) { constructor(propertyName, expression, opt_matchCase) {
ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase); super('PropertyIsEqualTo', propertyName, expression, opt_matchCase);
} }
} }
inherits(EqualTo, ComparisonBinary);
export default EqualTo; export default EqualTo;
+3 -2
View File
@@ -8,12 +8,13 @@
* Abstract class; normally only used for creating subclasses and not instantiated in apps. * Abstract class; normally only used for creating subclasses and not instantiated in apps.
* Base class for WFS GetFeature filters. * Base class for WFS GetFeature filters.
* *
* @constructor
* @abstract * @abstract
* @param {!string} tagName The XML tag name for this filter.
* @struct * @struct
*/ */
class Filter { class Filter {
/**
* @param {!string} tagName The XML tag name for this filter.
*/
constructor(tagName) { constructor(tagName) {
/** /**
+7 -11
View File
@@ -1,27 +1,23 @@
/** /**
* @module ol/format/filter/GreaterThan * @module ol/format/filter/GreaterThan
*/ */
import {inherits} from '../../util.js';
import ComparisonBinary from '../filter/ComparisonBinary.js'; import ComparisonBinary from '../filter/ComparisonBinary.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsGreaterThan>` comparison operator. * Represents a `<PropertyIsGreaterThan>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @extends {module:ol/format/filter/ComparisonBinary}
* @api
*/ */
class GreaterThan { class GreaterThan extends ComparisonBinary {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @api
*/
constructor(propertyName, expression) { constructor(propertyName, expression) {
ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression); super('PropertyIsGreaterThan', propertyName, expression);
} }
} }
inherits(GreaterThan, ComparisonBinary);
export default GreaterThan; export default GreaterThan;
+7 -11
View File
@@ -1,27 +1,23 @@
/** /**
* @module ol/format/filter/GreaterThanOrEqualTo * @module ol/format/filter/GreaterThanOrEqualTo
*/ */
import {inherits} from '../../util.js';
import ComparisonBinary from '../filter/ComparisonBinary.js'; import ComparisonBinary from '../filter/ComparisonBinary.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsGreaterThanOrEqualTo>` comparison operator. * Represents a `<PropertyIsGreaterThanOrEqualTo>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @extends {module:ol/format/filter/ComparisonBinary}
* @api
*/ */
class GreaterThanOrEqualTo { class GreaterThanOrEqualTo extends ComparisonBinary {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @api
*/
constructor(propertyName, expression) { constructor(propertyName, expression) {
ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression); super('PropertyIsGreaterThanOrEqualTo', propertyName, expression);
} }
} }
inherits(GreaterThanOrEqualTo, ComparisonBinary);
export default GreaterThanOrEqualTo; export default GreaterThanOrEqualTo;
+8 -14
View File
@@ -1,31 +1,25 @@
/** /**
* @module ol/format/filter/Intersects * @module ol/format/filter/Intersects
*/ */
import {inherits} from '../../util.js';
import Spatial from '../filter/Spatial.js'; import Spatial from '../filter/Spatial.js';
/** /**
* @classdesc * @classdesc
* Represents a `<Intersects>` operator to test whether a geometry-valued property * Represents a `<Intersects>` operator to test whether a geometry-valued property
* intersects a given geometry. * intersects a given geometry.
*
* @constructor
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/geom/Geometry} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @extends {module:ol/format/filter/Spatial}
* @api
*/ */
class Intersects { class Intersects extends Spatial {
/**
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/geom/Geometry} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
*/
constructor(geometryName, geometry, opt_srsName) { constructor(geometryName, geometry, opt_srsName) {
super('Intersects', geometryName, geometry, opt_srsName);
Spatial.call(this, 'Intersects', geometryName, geometry, opt_srsName);
} }
} }
inherits(Intersects, Spatial);
export default Intersects; export default Intersects;
+8 -12
View File
@@ -1,24 +1,22 @@
/** /**
* @module ol/format/filter/IsBetween * @module ol/format/filter/IsBetween
*/ */
import {inherits} from '../../util.js';
import Comparison from '../filter/Comparison.js'; import Comparison from '../filter/Comparison.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsBetween>` comparison operator. * Represents a `<PropertyIsBetween>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} lowerBoundary The lower bound of the range.
* @param {!number} upperBoundary The upper bound of the range.
* @extends {module:ol/format/filter/Comparison}
* @api
*/ */
class IsBetween { class IsBetween extends Comparison {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} lowerBoundary The lower bound of the range.
* @param {!number} upperBoundary The upper bound of the range.
* @api
*/
constructor(propertyName, lowerBoundary, upperBoundary) { constructor(propertyName, lowerBoundary, upperBoundary) {
Comparison.call(this, 'PropertyIsBetween', propertyName); super('PropertyIsBetween', propertyName);
/** /**
* @type {!number} * @type {!number}
@@ -33,6 +31,4 @@ class IsBetween {
} }
} }
inherits(IsBetween, Comparison);
export default IsBetween; export default IsBetween;
+15 -18
View File
@@ -1,30 +1,29 @@
/** /**
* @module ol/format/filter/IsLike * @module ol/format/filter/IsLike
*/ */
import {inherits} from '../../util.js';
import Comparison from '../filter/Comparison.js'; import Comparison from '../filter/Comparison.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsLike>` comparison operator. * Represents a `<PropertyIsLike>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!string} pattern Text pattern.
* @param {string=} opt_wildCard Pattern character which matches any sequence of
* zero or more string characters. Default is '*'.
* @param {string=} opt_singleChar pattern character which matches any single
* string character. Default is '.'.
* @param {string=} opt_escapeChar Escape character which can be used to escape
* the pattern characters. Default is '!'.
* @param {boolean=} opt_matchCase Case-sensitive?
* @extends {module:ol/format/filter/Comparison}
* @api
*/ */
class IsLike { class IsLike extends Comparison {
/**
* [constructor description]
* @param {!string} propertyName Name of the context property to compare.
* @param {!string} pattern Text pattern.
* @param {string=} opt_wildCard Pattern character which matches any sequence of
* zero or more string characters. Default is '*'.
* @param {string=} opt_singleChar pattern character which matches any single
* string character. Default is '.'.
* @param {string=} opt_escapeChar Escape character which can be used to escape
* the pattern characters. Default is '!'.
* @param {boolean=} opt_matchCase Case-sensitive?
* @api
*/
constructor(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) { constructor(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
Comparison.call(this, 'PropertyIsLike', propertyName); super('PropertyIsLike', propertyName);
/** /**
* @type {!string} * @type {!string}
@@ -54,6 +53,4 @@ class IsLike {
} }
} }
inherits(IsLike, Comparison);
export default IsLike; export default IsLike;
+6 -11
View File
@@ -1,27 +1,22 @@
/** /**
* @module ol/format/filter/IsNull * @module ol/format/filter/IsNull
*/ */
import {inherits} from '../../util.js';
import Comparison from '../filter/Comparison.js'; import Comparison from '../filter/Comparison.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsNull>` comparison operator. * Represents a `<PropertyIsNull>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @extends {module:ol/format/filter/Comparison}
* @api
*/ */
class IsNull { class IsNull extends Comparison {
/**
* @param {!string} propertyName Name of the context property to compare.
* @api
*/
constructor(propertyName) { constructor(propertyName) {
Comparison.call(this, 'PropertyIsNull', propertyName); super('PropertyIsNull', propertyName);
} }
} }
inherits(IsNull, Comparison);
export default IsNull; export default IsNull;
+7 -11
View File
@@ -1,27 +1,23 @@
/** /**
* @module ol/format/filter/LessThan * @module ol/format/filter/LessThan
*/ */
import {inherits} from '../../util.js';
import ComparisonBinary from '../filter/ComparisonBinary.js'; import ComparisonBinary from '../filter/ComparisonBinary.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsLessThan>` comparison operator. * Represents a `<PropertyIsLessThan>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @extends {module:ol/format/filter/ComparisonBinary}
* @api
*/ */
class LessThan { class LessThan extends ComparisonBinary {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @api
*/
constructor(propertyName, expression) { constructor(propertyName, expression) {
ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression); super('PropertyIsLessThan', propertyName, expression);
} }
} }
inherits(LessThan, ComparisonBinary);
export default LessThan; export default LessThan;
+7 -11
View File
@@ -1,27 +1,23 @@
/** /**
* @module ol/format/filter/LessThanOrEqualTo * @module ol/format/filter/LessThanOrEqualTo
*/ */
import {inherits} from '../../util.js';
import ComparisonBinary from '../filter/ComparisonBinary.js'; import ComparisonBinary from '../filter/ComparisonBinary.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsLessThanOrEqualTo>` comparison operator. * Represents a `<PropertyIsLessThanOrEqualTo>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @extends {module:ol/format/filter/ComparisonBinary}
* @api
*/ */
class LessThanOrEqualTo { class LessThanOrEqualTo extends ComparisonBinary {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare.
* @api
*/
constructor(propertyName, expression) { constructor(propertyName, expression) {
ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression); super('PropertyIsLessThanOrEqualTo', propertyName, expression);
} }
} }
inherits(LessThanOrEqualTo, ComparisonBinary);
export default LessThanOrEqualTo; export default LessThanOrEqualTo;
+6 -9
View File
@@ -1,7 +1,6 @@
/** /**
* @module ol/format/filter/LogicalNary * @module ol/format/filter/LogicalNary
*/ */
import {inherits} from '../../util.js';
import {assert} from '../../asserts.js'; import {assert} from '../../asserts.js';
import Filter from '../filter/Filter.js'; import Filter from '../filter/Filter.js';
@@ -10,17 +9,17 @@ import Filter from '../filter/Filter.js';
* Abstract class; normally only used for creating subclasses and not instantiated in apps. * Abstract class; normally only used for creating subclasses and not instantiated in apps.
* Base class for WFS GetFeature n-ary logical filters. * Base class for WFS GetFeature n-ary logical filters.
* *
* @constructor
* @abstract * @abstract
* @param {!string} tagName The XML tag name for this filter.
* @param {...module:ol/format/filter/Filter} conditions Conditions.
* @extends {module:ol/format/filter/Filter}
*/ */
class LogicalNary { class LogicalNary extends Filter {
/**
* @param {!string} tagName The XML tag name for this filter.
* @param {...module:ol/format/filter/Filter} conditions Conditions.
*/
constructor(tagName, conditions) { constructor(tagName, conditions) {
Filter.call(this, tagName); super(tagName);
/** /**
* @type {Array.<module:ol/format/filter/Filter>} * @type {Array.<module:ol/format/filter/Filter>}
@@ -31,6 +30,4 @@ class LogicalNary {
} }
inherits(LogicalNary, Filter);
export default LogicalNary; export default LogicalNary;
+6 -9
View File
@@ -1,23 +1,21 @@
/** /**
* @module ol/format/filter/Not * @module ol/format/filter/Not
*/ */
import {inherits} from '../../util.js';
import Filter from '../filter/Filter.js'; import Filter from '../filter/Filter.js';
/** /**
* @classdesc * @classdesc
* Represents a logical `<Not>` operator for a filter condition. * Represents a logical `<Not>` operator for a filter condition.
*
* @constructor
* @param {!module:ol/format/filter/Filter} condition Filter condition.
* @extends {module:ol/format/filter/Filter}
* @api
*/ */
class Not { class Not extends Filter {
/**
* @param {!module:ol/format/filter/Filter} condition Filter condition.
* @api
*/
constructor(condition) { constructor(condition) {
Filter.call(this, 'Not'); super('Not');
/** /**
* @type {!module:ol/format/filter/Filter} * @type {!module:ol/format/filter/Filter}
@@ -28,5 +26,4 @@ class Not {
} }
inherits(Not, Filter);
export default Not; export default Not;
+8 -12
View File
@@ -1,28 +1,24 @@
/** /**
* @module ol/format/filter/NotEqualTo * @module ol/format/filter/NotEqualTo
*/ */
import {inherits} from '../../util.js';
import ComparisonBinary from '../filter/ComparisonBinary.js'; import ComparisonBinary from '../filter/ComparisonBinary.js';
/** /**
* @classdesc * @classdesc
* Represents a `<PropertyIsNotEqualTo>` comparison operator. * Represents a `<PropertyIsNotEqualTo>` comparison operator.
*
* @constructor
* @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive?
* @extends {module:ol/format/filter/ComparisonBinary}
* @api
*/ */
class NotEqualTo { class NotEqualTo extends ComparisonBinary {
/**
* @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive?
* @api
*/
constructor(propertyName, expression, opt_matchCase) { constructor(propertyName, expression, opt_matchCase) {
ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase); super('PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
} }
} }
inherits(NotEqualTo, ComparisonBinary);
export default NotEqualTo; export default NotEqualTo;
+6 -10
View File
@@ -1,27 +1,23 @@
/** /**
* @module ol/format/filter/Or * @module ol/format/filter/Or
*/ */
import {inherits} from '../../util.js';
import LogicalNary from '../filter/LogicalNary.js'; import LogicalNary from '../filter/LogicalNary.js';
/** /**
* @classdesc * @classdesc
* Represents a logical `<Or>` operator between two ore more filter conditions. * Represents a logical `<Or>` operator between two ore more filter conditions.
*
* @constructor
* @param {...module:ol/format/filter/Filter} conditions Conditions.
* @extends {module:ol/format/filter/LogicalNary}
* @api
*/ */
class Or { class Or extends LogicalNary {
/**
* @param {...module:ol/format/filter/Filter} conditions Conditions.
* @api
*/
constructor(conditions) { constructor(conditions) {
const params = ['Or'].concat(Array.prototype.slice.call(arguments)); const params = ['Or'].concat(Array.prototype.slice.call(arguments));
LogicalNary.apply(this, params); super(...params);
} }
} }
inherits(Or, LogicalNary);
export default Or; export default Or;
+9 -12
View File
@@ -1,7 +1,6 @@
/** /**
* @module ol/format/filter/Spatial * @module ol/format/filter/Spatial
*/ */
import {inherits} from '../../util.js';
import Filter from '../filter/Filter.js'; import Filter from '../filter/Filter.js';
/** /**
@@ -10,20 +9,20 @@ import Filter from '../filter/Filter.js';
* Represents a spatial operator to test whether a geometry-valued property * Represents a spatial operator to test whether a geometry-valued property
* relates to a given geometry. * relates to a given geometry.
* *
* @constructor
* @abstract * @abstract
* @param {!string} tagName The XML tag name for this filter.
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/geom/Geometry} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
* @extends {module:ol/format/filter/Filter}
*/ */
class Spatial { class Spatial extends Filter {
/**
* @param {!string} tagName The XML tag name for this filter.
* @param {!string} geometryName Geometry name to use.
* @param {!module:ol/geom/Geometry} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided.
*/
constructor(tagName, geometryName, geometry, opt_srsName) { constructor(tagName, geometryName, geometry, opt_srsName) {
Filter.call(this, tagName); super(tagName);
/** /**
* @type {!string} * @type {!string}
@@ -43,6 +42,4 @@ class Spatial {
} }
inherits(Spatial, Filter);
export default Spatial; export default Spatial;