"use strict"; var ArrayMatchingMatchExpression = require('./ArrayMatchingMatchExpression'); // Autogenerated by cport.py on 2013-09-17 14:37 var SizeMatchExpression = module.exports = function SizeMatchExpression(){ base.call(this); this._matchType = 'SIZE'; }, klass = SizeMatchExpression, base = ArrayMatchingMatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); // File: expression_array.h lines: 131-131 proto._size = undefined; /** * * Writes a debug string for this object * @method debugString * @param level * */ proto.debugString = function debugString(level) { // File: expression_array.cpp lines: 259-261 return this._debugAddSpace( level ) + this.path() + " $size : " + this._size.toString() + "\n"; }; /** * * checks if this expression is == to the other * @method equivalent * @param other * */ proto.equivalent = function equivalent(other) { // File: expression_array.cpp lines: 264-269 if(other._matchType != 'SIZE') { return false; } return this._size == other._size && this._path == other._path; }; /** * * Return the _size property * @method getData * */ proto.getData = function getData(){ // File: expression_array.h lines: 128-127 return this._size; }; /** * * Initialize the necessary items * @method init * @param path * @param size * */ proto.init = function init(path,size) { // File: expression_array.cpp lines: 248-250 if(size === null) return {code:'BAD_VALUE', 'description':'Cannot assign null to size'}; this._size = size; return this.initPath(path); }; /** * * Check if the input array matches * @method matchesArray * @param anArray * @param details * */ proto.matchesArray = function matchesArray(anArray, details) { // File: expression_array.cpp lines: 253-256 if(this._size < 0) { return false; } return anArray.length == this._size; }; /** * * clone this instance to a new one * @method shallowClone * */ proto.shallowClone = function shallowClone(){ // File: expression_array.h lines: 116-119 var e = new SizeMatchExpression(); e.init(this.path(),this._size); return e; };