Blame view

SerialNumber.java 569 Bytes
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
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";
    }


}