tp_address_smsc.java

来自「排课系统」· Java 代码 · 共 49 行

JAVA
49
字号
package org.cross.sms.msg;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class TP_Address_SMSC extends TP_Address {
    public TP_Address_SMSC() {
        super();
    }

    public int getTotalLength() {
        return m_len * 2 + 2;
    }

    public void setPhone(String phone){
        init();
        m_code = phone;
        String str1, str2, pdu = "";
        if (phone == null) {
            m_pdu ="";
            return;
        }
        if ((phone != null) && (phone.length() == 0)) {
            m_pdu = "00";
            return;
        }
        str1 = "91" + _CharacterUtil.toBCDFormat(phone.substring(1));//去除+号
        str2 = Integer.toHexString(str1.length() / 2);
        m_type = "91";
        m_len = str1.length()/2;
        if (str2.length() != 2) {
            str2 = "0" + str2;
        }
        pdu = pdu + str2 + str1;
        m_pdu = pdu;
    }


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?