NorMatchExpression.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. "use strict";
  2. var ListOfMatchExpression = require('./ListOfMatchExpression');
  3. // Autogenerated by cport.py on 2013-09-17 14:37
  4. var NorMatchExpression = module.exports = function NorMatchExpression(){
  5. }, klass = NorMatchExpression, base = ListOfMatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  6. /**
  7. *
  8. * This documentation was automatically generated. Please update when you touch this function.
  9. * @method debugString
  10. * @param
  11. *
  12. */
  13. proto.debugString = function debugString( level ) { // StringBuilder& debug, int level
  14. // File: expression_tree.cpp lines: 138-141
  15. return this._debugAddSpace( level ) + "$nor\n" + this._debugList( level );
  16. };
  17. /**
  18. *
  19. * This documentation was automatically generated. Please update when you touch this function.
  20. * @method matches
  21. * @param
  22. *
  23. */
  24. proto.matches = function matches( doc,detail ) { // const MatchableDocument* doc, MatchDetails* details
  25. // File: expression_tree.cpp lines: 120-126
  26. for (var i = 0; i < this.numChildren(); i++) {
  27. if( this.getChild(i).matches( doc, null )) {
  28. return false;
  29. }
  30. }
  31. return true;
  32. };
  33. /**
  34. *
  35. * This documentation was automatically generated. Please update when you touch this function.
  36. * @method matchesSingleElement
  37. * @param
  38. *
  39. */
  40. proto.matchesSingleElement = function matchesSingleElement( e ) { // const BSONElement& e
  41. // File: expression_tree.cpp lines: 129-135
  42. for (var i = 0; i < this.numChildren(); i++) {
  43. if( this.getChild(i).matchesSingleElement( e )) {
  44. return false;
  45. }
  46. }
  47. return true;
  48. };
  49. /**
  50. *
  51. * This documentation was automatically generated. Please update when you touch this function.
  52. * @method shallowClone
  53. * @param
  54. *
  55. */
  56. proto.shallowClone = function shallowClone( /* */ ){
  57. // File: expression_tree.h lines: 105-110
  58. // virtual MatchExpression* shallowClone() const {
  59. // NorMatchExpression* self = new NorMatchExpression();
  60. // for (size_t i = 0; i < numChildren(); ++i) {
  61. // self->add(getChild(i)->shallowClone());
  62. // }
  63. // return self;
  64. // }
  65. var e = new NorMatchExpression();
  66. for (var i = 0; i < this.numChildren(); i++) {
  67. e.add(this.getChild(i).shallowClone());
  68. }
  69. return e;
  70. };