package com.zfdang.zsmth_android.models;

/**
 * Created by zfdang on 2016-3-14.
 */
public class Board{

    private String boardID;
    private String boardEngName;
    private String boardChsName;
    private String categoryName;
    private String moderator;

    // 可能是个版面的目录，而不是具体的版面
    private boolean isFolder;
    private String folderName;
    private String folderID;


    public Board(String id, String chsName, String enName) {
        isFolder = false;
        this.boardID = id;
        this.boardChsName = chsName;
        this.boardEngName = enName;
    }


    public Board(String folderID, String folderName) {
        isFolder = true;
        this.folderID = folderID;
        this.folderName = folderName;
        this.categoryName = "目录";
    }

    public String getBoardID() {
        return boardID;
    }

    public String getBoardEngName() {
        return boardEngName;
    }

    public String getBoardChsName() {
        return boardChsName;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public String getModerator() {
        return moderator;
    }

    public boolean isFolder() {
        return isFolder;
    }

    public String getFolderName() {
        return folderName;
    }

    public String getFolderID() {
        return folderID;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public void setModerator(String moderator) {
        this.moderator = moderator;
    }

    @Override
    public String toString() {
        return "Board{" +
                "boardID='" + boardID + '\'' +
                ", boardEngName='" + boardEngName + '\'' +
                ", boardChsName='" + boardChsName + '\'' +
                ", categoryName='" + categoryName + '\'' +
                ", moderator='" + moderator + '\'' +
                ", isFolder=" + isFolder +
                ", folderName='" + folderName + '\'' +
                ", folderID='" + folderID + '\'' +
                '}';
    }

}

@@ -39,71 +39,285 @@
 s;%0A%0A
-/**%0A * Created by zfdang on 2016-3-14.%0A */%0Apublic class Board%7B%0A
+import java.io.Externalizable;%0Aimport java.io.IOException;%0Aimport java.io.ObjectInput;%0Aimport java.io.ObjectOutput;%0A%0A/**%0A * Created by zfdang on 2016-3-14.%0A */%0Apublic class Board implements Externalizable%7B%0A%0A    // %E5%85%B7%E4%BD%93%E7%9A%84%E7%89%88%E9%9D%A2%0A    // http://www.newsmth.net/nForum/#!board/DrivingStudy
 %0A   
@@ -369,24 +369,36 @@
 oardEngName;
+  // Android
 %0A    private
@@ -414,24 +414,35 @@
 oardChsName;
+  // %E5%AE%89%E5%8D%93%E7%B3%BB%E7%BB%9F%E8%AE%BE%E5%A4%87
 %0A    private
@@ -458,24 +458,33 @@
 ategoryName;
+  // %E7%94%B5%E8%84%91%E6%8A%80%E6%9C%AF
 %0A    private
@@ -501,16 +501,22 @@
 derator;
+ // %E7%89%88%E4%B8%BB
 %0A%0A    //
@@ -531,24 +531,82 @@
 %E7%9B%AE%E5%BD%95%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E5%85%B7%E4%BD%93%E7%9A%84%E7%89%88%E9%9D%A2%0A
+    // http://www.newsmth.net/nForum/#!section/Automobile%0A
     private 
@@ -649,24 +649,31 @@
  folderName;
+  // %E6%B1%BD%E8%BD%A6
 %0A    private
@@ -689,16 +689,33 @@
 olderID;
+    // Automobile
 %0A%0A%0A    p
@@ -2372,10 +2372,927 @@
 %0A    %7D%0A%0A
+    @Override%0A    public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException %7B%0A        boardID = (String) input.readObject();%0A        boardEngName = (String) input.readObject();%0A        boardChsName = (String) input.readObject();%0A        categoryName = (String) input.readObject();%0A        moderator = (String) input.readObject();%0A%0A        isFolder = input.readBoolean();%0A        folderID = (String) input.readObject();%0A        folderName = (String) input.readObject();%0A    %7D%0A%0A    @Override%0A    public void writeExternal(ObjectOutput output) throws IOException %7B%0A        output.writeObject(boardID);%0A        output.writeObject(boardEngName);%0A        output.writeObject(boardChsName);%0A        output.writeObject(categoryName);%0A        output.writeObject(moderator);%0A%0A        output.writeBoolean(isFolder);%0A        output.writeObject(folderID);%0A        output.writeObject(folderName);%0A    %7D%0A
 %7D%0A

add comments, implement externalizable