AtomicMatchExpression.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. "use strict";
  2. var MatchExpression = require('./MatchExpression');
  3. // Autogenerated by cport.py on 2013-09-17 14:37
  4. // File: expression.h
  5. var AtomicMatchExpression = module.exports = function AtomicMatchExpression(){
  6. base.call(this);
  7. this._matchType = 'ATOMIC';
  8. }, klass = AtomicMatchExpression, base = MatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  9. /**
  10. *
  11. * Writes a debug string for this object
  12. * @method debugString
  13. * @param level
  14. *
  15. */
  16. proto.debugString = function debugString(level) {
  17. return this._debugAddSpace( level ) + "$atomic\n";
  18. };
  19. /**
  20. *
  21. * checks if this expression is == to the other
  22. * @method equivalent
  23. * @param other
  24. *
  25. */
  26. proto.equivalent = function equivalent(other) {
  27. return other._matchType === this._matchType;
  28. };
  29. /**
  30. *
  31. * matches checks the input doc against the internal element path to see if it is a match
  32. * @method matches
  33. * @param doc
  34. *
  35. */
  36. proto.matches = function matches(doc) {
  37. return true;
  38. };
  39. /**
  40. *
  41. * Check if the input element matches
  42. * @method matchesSingleElement
  43. * @param e
  44. *
  45. */
  46. proto.matchesSingleElement = function matchesSingleElement(e) {
  47. return true;
  48. };
  49. /**
  50. *
  51. * clone this instance to a new one
  52. * @method shallowClone
  53. *
  54. */
  55. proto.shallowClone = function shallowClone(){
  56. return new AtomicMatchExpression();
  57. };