package com.sogou.sogouchat.bean;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
public class TelNumNode implements Parcelable {
public String mNum;
public int mType;
public int mMsgCnt;
public int mNewMsgCnt;
public long mLastDate;
public String mLastBody;
public ArrayList<MsgNode> mMsgList;
@Override
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
public TelNumNode(){
}
TelNumNode(Parcel in){
// Log.i("TelNumNode", "TelNumNode" + mNum);
mNum = in.readString();
mType = in.readInt();
mMsgCnt = in.readInt();
mNewMsgCnt = in.readInt();
mLastDate = in.readLong();
mLastBody = in.readString();
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.writeString(mNum);
dest.writeInt(mType);
dest.writeInt(mMsgCnt);
dest.writeInt(mNewMsgCnt);
dest.writeLong(mLastDate);
dest.writeString(mLastBody);
if (mMsgCnt > 0){
dest.writeTypedList(mMsgList);
}
}
public static final Parcelable.Creator<TelNumNode> CREATOR = new Parcelable.Creator<TelNumNode>() {
public TelNumNode createFromParcel(Parcel in){
return new TelNumNode(in);
}
public TelNumNode[] newArray(int size){
return new TelNumNode[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();
}
}
}
}