home *** CD-ROM | disk | FTP | other *** search
- class mx.data.components.datasetclasses.DeltaImpl extends Object implements mx.data.components.datasetclasses.Delta
- {
- var _deltaItems;
- var _id;
- var _source;
- var _op;
- var _message;
- var _accessCl;
- var _owner;
- function DeltaImpl(id, curSrc, op, msg, acl)
- {
- super();
- this._deltaItems = new Array();
- this._id = id;
- this._source = curSrc;
- this._op = op;
- this._message = msg != undefined ? msg : "";
- this._accessCl = acl != undefined ? acl : false;
- }
- function addDeltaItem(item)
- {
- var _loc2_ = this.getItemIndexByName(item.name);
- if(_loc2_ < 0 || item.kind == mx.data.components.datasetclasses.DeltaItem.Method)
- {
- this._deltaItems.push(item);
- }
- else
- {
- this._deltaItems.splice(_loc2_,1);
- this._deltaItems.splice(_loc2_,0,item);
- }
- }
- function getId()
- {
- return this._id;
- }
- function getOperation()
- {
- return this._op;
- }
- function getChangeList()
- {
- if(this._op != mx.data.components.datasetclasses.DeltaPacketConsts.Added || this._accessCl)
- {
- return this._deltaItems;
- }
- return null;
- }
- function getItemByName(name)
- {
- var _loc2_ = this.getItemIndexByName(name);
- if(_loc2_ >= 0)
- {
- return this._deltaItems[_loc2_];
- }
- return null;
- }
- function getSource()
- {
- var _loc4_ = this._source;
- if(this._op == mx.data.components.datasetclasses.DeltaPacketConsts.Added && arguments.length > 0)
- {
- if(this._source.clone == undefined)
- {
- _loc4_ = new Object();
- var _loc3_ = undefined;
- for(var _loc5_ in this._source)
- {
- _loc3_ = this._source[_loc5_];
- if(typeof _loc3_ != "function")
- {
- _loc4_[_loc5_] = _loc3_;
- }
- }
- }
- else
- {
- _loc4_ = this._source.clone();
- }
- }
- return _loc4_;
- }
- function getMessage()
- {
- return this._message;
- }
- function getDeltaPacket()
- {
- return this._owner;
- }
- function getItemIndexByName(name)
- {
- var _loc3_ = undefined;
- if(this._op == mx.data.components.datasetclasses.DeltaPacketConsts.Modified || this._accessCl)
- {
- var _loc2_ = 0;
- while(_loc2_ < this._deltaItems.length)
- {
- _loc3_ = this._deltaItems[_loc2_];
- if(_loc3_.name == name)
- {
- return _loc2_;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- return -1;
- }
- }
-