NorMatchExpression.js 2.2 KB

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