src/basis/data/dataset/MapFilter.js
function(){
    var sourceMap = this.sourceMap_;
    var memberMap = this.members_;
    var curMember;
    var newMember;
    var curMemberId;
    var newMemberId;
    var sourceObject;
    var sourceObjectInfo;
    var inserted = [];
    var deleted = [];
    var delta;

    for (var sourceObjectId in sourceMap)
    {
      sourceObjectInfo = sourceMap[sourceObjectId];
      sourceObject = sourceObjectInfo.sourceObject;

      curMember = sourceObjectInfo.member;
      newMember = this.map ? this.map(sourceObject) : sourceObject;

      if (newMember instanceof DataObject == false || this.filter(newMember))
        newMember = null;

      if (!isEqual(curMember, newMember))
      {
        sourceObjectInfo.member = newMember;

        // if here is ref for member already
        if (curMember)
        {
          curMemberId = curMember.basisObjectId;

          // call callback on member ref add
          if (this.removeMemberRef)
            this.removeMemberRef(curMember, sourceObject);

          // decrease ref count
          memberMap[curMemberId]--;
        }

        // if new member exists, update map
        if (newMember)
        {
          newMemberId = newMember.basisObjectId;

          // call callback on member ref add
          if (this.addMemberRef)
            this.addMemberRef(newMember, sourceObject);

          if (newMemberId in memberMap)
          {
            // member is already in map -> increase ref count
            memberMap[newMemberId]++;
          }
          else
          {
            // add to map
            memberMap[newMemberId] = 1;

            // add to delta
            inserted.push(newMember);
          }
        }
      }
    }

    // get deleted delta
    for (curMemberId in this.items_)
      if (memberMap[curMemberId] == 0)
      {
        delete memberMap[curMemberId];
        deleted.push(this.items_[curMemberId]);
      }

    // if any changes, fire event
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
function(){
    var sourceMap = this.sourceMap_;
    var memberMap = this.members_;
    var curMember;
    var newMember;
    var curMemberId;
    var newMemberId;
    var sourceObject;
    var sourceObjectInfo;
    var inserted = [];
    var deleted = [];
    var delta;

    for (var sourceObjectId in sourceMap)
    {
      sourceObjectInfo = sourceMap[sourceObjectId];
      sourceObject = sourceObjectInfo.sourceObject;

      curMember = sourceObjectInfo.member;
      newMember = this.map ? this.map(sourceObject) : sourceObject;

      if (newMember instanceof DataObject == false || this.filter(newMember))
        newMember = null;

      if (!isEqual(curMember, newMember))
      {
        sourceObjectInfo.member = newMember;

        // if here is ref for member already
        if (curMember)
        {
          curMemberId = curMember.basisObjectId;

          // call callback on member ref add
          if (this.removeMemberRef)
            this.removeMemberRef(curMember, sourceObject);

          // decrease ref count
          memberMap[curMemberId]--;
        }

        // if new member exists, update map
        if (newMember)
        {
          newMemberId = newMember.basisObjectId;

          // call callback on member ref add
          if (this.addMemberRef)
            this.addMemberRef(newMember, sourceObject);

          if (newMemberId in memberMap)
          {
            // member is already in map -> increase ref count
            memberMap[newMemberId]++;
          }
          else
          {
            // add to map
            memberMap[newMemberId] = 1;

            // add to delta
            inserted.push(newMember);
          }
        }
      }
    }

    // get deleted delta
    for (curMemberId in this.items_)
      if (memberMap[curMemberId] == 0)
      {
        delete memberMap[curMemberId];
        deleted.push(this.items_[curMemberId]);
      }

    // if any changes, fire event
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
function ( ) { var sourceMap = this . sourceMap_ ; var memberMap = this . members_ ; var curMember ; var newMember ; var curMemberId ; var newMemberId ; var sourceObject ; var sourceObjectInfo ; var inserted = [ ] ; var deleted = [ ] ; var delta ; for ( var sourceObjectId in sourceMap ) { sourceObjectInfo = sourceMap [ sourceObjectId ] ; sourceObject = sourceObjectInfo . sourceObject ; curMember = sourceObjectInfo . member ; newMember = this . map ? this . map ( sourceObject ) : sourceObject ; if ( newMember instanceof DataObject == false || this . filter ( newMember ) ) newMember = null ; if ( ! isEqual ( curMember , newMember ) ) { sourceObjectInfo . member = newMember ; // if here is ref for member already if ( curMember ) { curMemberId = curMember . basisObjectId ; // call callback on member ref add if ( this . removeMemberRef ) this . removeMemberRef ( curMember , sourceObject ) ; // decrease ref count memberMap [ curMemberId ] -- ; } // if new member exists, update map if ( newMember ) { newMemberId = newMember . basisObjectId ; // call callback on member ref add if ( this . addMemberRef ) this . addMemberRef ( newMember , sourceObject ) ; if ( newMemberId in memberMap ) { // member is already in map -> increase ref count memberMap [ newMemberId ] ++ ; } else { // add to map memberMap [ newMemberId ] = 1 ; // add to delta inserted . push ( newMember ) ; } } } } // get deleted delta for ( curMemberId in this . items_ ) if ( memberMap [ curMemberId ] == 0 ) { delete memberMap [ curMemberId ] ; deleted . push ( this . items_ [ curMemberId ] ) ; } // if any changes, fire event if ( delta = getDelta ( inserted , deleted ) ) this . emit_itemsChanged ( delta ) ; return delta ; }
Apply transform for all source objects and rebuild member set.
@return {Object} Delta of member changes.
Apply transform for all source objects and rebuild member set .