SerialNumber.java 569 Bytes
package com.meishu.util.tree;

public class SerialNumber{

    public String produceNext(String crrnt) {

        String next = "0";
        if (crrnt != null) {
            try {
                int crrntNum = Integer.parseInt(crrnt);
                next = String.valueOf(crrntNum + 1);
            } catch (Exception e) {
                System.err.println("非数字类型的字符串!");
            }
        }
        return next;
    }

    public String rootNumber() {
        return "0";
    }

    public String firstNumber() {
        return "1";
    }


}