Esempio n. 1
0
    /// <summary>
    /// 转文本输出
    /// </summary>
    protected override void toWriteDataString(DataWriter writer)
    {
        writer.writeTabs();
        writer.sb.Append("friends");
        writer.sb.Append(':');
        writer.sb.Append("Map<long,FriendData>");
        if (this.friends != null)
        {
            writer.sb.Append('(');
            writer.sb.Append(this.friends.size());
            writer.sb.Append(')');
            writer.writeEnter();
            writer.writeLeftBrace();
            if (!this.friends.isEmpty())
            {
                long         friendsKFreeValue = this.friends.getFreeValue();
                long[]       friendsKKeys      = this.friends.getKeys();
                FriendData[] friendsVValues    = this.friends.getValues();
                for (int friendsKI = friendsKKeys.Length - 1; friendsKI >= 0; --friendsKI)
                {
                    long friendsK = friendsKKeys[friendsKI];
                    if (friendsK != friendsKFreeValue)
                    {
                        FriendData friendsV = friendsVValues[friendsKI];
                        writer.writeTabs();
                        writer.sb.Append(friendsK);

                        writer.sb.Append(':');
                        if (friendsV != null)
                        {
                            friendsV.writeDataString(writer);
                        }
                        else
                        {
                            writer.sb.Append("FriendData=null");
                        }

                        writer.writeEnter();
                    }
                }
            }
            writer.writeRightBrace();
        }
        else
        {
            writer.sb.Append("=null");
        }

        writer.writeEnter();
        writer.writeTabs();
        writer.sb.Append("blackList");
        writer.sb.Append(':');
        writer.sb.Append("Map<long,ContactData>");
        if (this.blackList != null)
        {
            writer.sb.Append('(');
            writer.sb.Append(this.blackList.size());
            writer.sb.Append(')');
            writer.writeEnter();
            writer.writeLeftBrace();
            if (!this.blackList.isEmpty())
            {
                long          blackListKFreeValue = this.blackList.getFreeValue();
                long[]        blackListKKeys      = this.blackList.getKeys();
                ContactData[] blackListVValues    = this.blackList.getValues();
                for (int blackListKI = blackListKKeys.Length - 1; blackListKI >= 0; --blackListKI)
                {
                    long blackListK = blackListKKeys[blackListKI];
                    if (blackListK != blackListKFreeValue)
                    {
                        ContactData blackListV = blackListVValues[blackListKI];
                        writer.writeTabs();
                        writer.sb.Append(blackListK);

                        writer.sb.Append(':');
                        if (blackListV != null)
                        {
                            blackListV.writeDataString(writer);
                        }
                        else
                        {
                            writer.sb.Append("ContactData=null");
                        }

                        writer.writeEnter();
                    }
                }
            }
            writer.writeRightBrace();
        }
        else
        {
            writer.sb.Append("=null");
        }

        writer.writeEnter();
        writer.writeTabs();
        writer.sb.Append("applyDic");
        writer.sb.Append(':');
        writer.sb.Append("Map<long,ApplyAddFriendData>");
        if (this.applyDic != null)
        {
            writer.sb.Append('(');
            writer.sb.Append(this.applyDic.size());
            writer.sb.Append(')');
            writer.writeEnter();
            writer.writeLeftBrace();
            if (!this.applyDic.isEmpty())
            {
                long   applyDicKFreeValue            = this.applyDic.getFreeValue();
                long[] applyDicKKeys                 = this.applyDic.getKeys();
                ApplyAddFriendData[] applyDicVValues = this.applyDic.getValues();
                for (int applyDicKI = applyDicKKeys.Length - 1; applyDicKI >= 0; --applyDicKI)
                {
                    long applyDicK = applyDicKKeys[applyDicKI];
                    if (applyDicK != applyDicKFreeValue)
                    {
                        ApplyAddFriendData applyDicV = applyDicVValues[applyDicKI];
                        writer.writeTabs();
                        writer.sb.Append(applyDicK);

                        writer.sb.Append(':');
                        if (applyDicV != null)
                        {
                            applyDicV.writeDataString(writer);
                        }
                        else
                        {
                            writer.sb.Append("ApplyAddFriendData=null");
                        }

                        writer.writeEnter();
                    }
                }
            }
            writer.writeRightBrace();
        }
        else
        {
            writer.sb.Append("=null");
        }

        writer.writeEnter();
    }