package com.sogouchat.bean;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
public class TelNode implements Parcelable {
public int mContactId;
public int mPhotoId;
public Drawable mPhoto;
public String mName;
public String mPinyin;
public String mCapPinyin;
public String mTel;
public String mAddress;
public int mThreadId;
public int mType;
public int mMsgCnt;
public int mUnMsgCnt;
public long mLastDate;
public String mLastBody;
public int mBodyCs;
public ArrayList<MsgNode> mMsgList;
@Override
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
public TelNode(){
}
TelNode(Parcel in){
// Log.i("TelNumNode", "TelNumNode" + mNum);
mContactId = in.readInt();
mPhotoId = in.readInt();
mName = in.readString();
mPinyin = in.readString();
mTel = in.readString();
mAddress = in.readString();
mThreadId = in.readInt();
mType = in.readInt();
mMsgCnt = in.readInt();
mUnMsgCnt = in.readInt();
mLastDate = in.readLong();
mLastBody = in.readString();
mBodyCs = in.readInt();
if (mMsgCnt > 0){
mMsgList = new ArrayList<MsgNode>();
in.readTypedList(mMsgList, MsgNode.CREATOR);
}
}
@Override
public void writeToParcel(Parcel dest, int flags) {
// TODO Auto-generated method stub
// Log.i("TelNumNode", "writeToParcel" + mNum);
dest.writeInt(mContactId);
dest.writeInt(mPhotoId);
dest.writeString(mName);
dest.writeString(mPinyin);
dest.writeString(mTel);
dest.writeString(mAddress);
dest.writeInt(mThreadId);
dest.writeInt(mType);
dest.writeInt(mMsgCnt);
dest.writeInt(mUnMsgCnt);
dest.writeLong(mLastDate);
dest.writeString(mLastBody);
dest.writeInt(mBodyCs);
if (mMsgCnt > 0){
dest.writeTypedList(mMsgList);
}
}
public static final Parcelable.Creator<TelNode> CREATOR = new Parcelable.Creator<TelNode>() {
public TelNode createFromParcel(Parcel in){
return new TelNode(in);
}
public TelNode[] newArray(int size){
return new TelNode[size];
}
};
public void logTo(){
// Log.i("mNum", mNum);
if (mMsgCnt>0){
Iterator<MsgNode> it = mMsgList.iterator();
while(it.hasNext()){
MsgNode node = it.next();
node.logTo();
}
}
}
}