<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    夢幻之旅

    DEBUG - 天道酬勤

       :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
    package com.roadway.sms.util;

    /**
     * 
    @author Huyvanpull
     *
     
    */
    public class Mobile
    {
        
    /**
         * 中國移動擁有號碼段為:139,138,137,136,135,134,159,158,157(3G),151,150,188(3G),187(3G);13個號段
         * 中國聯通擁有號碼段為:130,131,132,156(3G),186(3G),185(3G);6個號段
         * 中國電信擁有號碼段為:133,153,189(3G),180(3G);4個號碼段
         
    */
        
    private static String regMobileStr    = "^1(([3][456789])|([5][01789])|([8][78]))[0-9]{8}$";
        
    private static String regMobile3GStr  = "^((157)|(18[78]))[0-9]{8}$";
        
    private static String regUnicomStr    = "^1(([3][012])|([5][6])|([8][56]))[0-9]{8}$";
        
    private static String regUnicom3GStr  = "^((156)|(18[56]))[0-9]{8}$";
        
    private static String regTelecomStr   = "^1(([3][3])|([5][3])|([8][09]))[0-9]{8}$";
        
    private static String regTelocom3GStr = "^(18[09])[0-9]{8}$";
        
        
    private String mobile       = "";
        
    private int facilitatorType = 0;
        
    private boolean isLawful    = false;
        
    private boolean is3G        = false;
        
        
    public Mobile(String mobile)
        {
            
    this.setMobile(mobile);
        }
        
        
    public void setMobile(String mobile)
        {
            
    if (mobile == null)
            {
                
    return;
            }
            
    /** 第一步判斷中國移動 */
            
    if (mobile.matches(Mobile.regMobileStr))
            {
                
    this.mobile = mobile;
                
    this.setFacilitatorType(0);
                
    this.setLawful(true);
                
    if (mobile.matches(Mobile.regMobile3GStr))
                {
                    
    this.setIs3G(true);
                }
            }
            
    /** 第二步判斷中國聯通 */
            
    else if (mobile.matches(Mobile.regUnicomStr))
            {
                
    this.mobile = mobile;
                
    this.setFacilitatorType(1);
                
    this.setLawful(true);
                
    if (mobile.matches(Mobile.regUnicom3GStr))
                {
                    
    this.setIs3G(true);
                }
            }
            
    /** 第三步判斷中國電腦 */
            
    else if (mobile.matches(Mobile.regTelecomStr))
            {
                
    this.mobile = mobile;
                
    this.setFacilitatorType(2);
                
    this.setLawful(true);
                
    if (mobile.matches(Mobile.regTelocom3GStr))
                {
                    
    this.setIs3G(true);
                }
            }
        }
        
        
    public String getMobile()
        {
            
    return mobile;
        }
        
        
    public int getFacilitatorType()
        {
            
    return facilitatorType;
        }
        
        
    public boolean isLawful()
        {
            
    return isLawful;
        }
        
        
    public boolean isIs3G()
        {
            
    return is3G;
        }
        
    private void setFacilitatorType(int facilitatorType)
        {
            
    this.facilitatorType = facilitatorType;
        }

        
    private void setLawful(boolean isLawful)
        {
            
    this.isLawful = isLawful;
        }

        
    private void setIs3G(boolean is3G)
        {
            
    this.is3G = is3G;
        }
        
    public String toString()
        {
            StringBuffer str 
    = new StringBuffer();
            str.append(
    "mobile:").append(this.getMobile()).append(",");
            str.append(
    "facilitatorType:").append(this.getFacilitatorType()).append(",");
            str.append(
    "isLawful:").append(this.isLawful()).append(",");
            str.append(
    "is3G:").append(this.isIs3G()).append(";");
            
    return str.toString();
        }
        
    public static void main(String[] args)
        {
            Mobile mobile 
    = new Mobile("18001678250");
            System.out.println(mobile.toString());
        }
    }
    posted on 2009-02-23 17:27 HUIKK 閱讀(269) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 亚洲一区二区三区免费| www.亚洲精品| 亚洲国产综合精品| 亚洲精品免费在线视频| 亚洲首页在线观看| 韩国免费一级成人毛片| 中文字幕亚洲综合小综合在线| 久久国内免费视频| 亚洲熟女乱色一区二区三区| 免费高清小黄站在线观看| 亚洲JLZZJLZZ少妇| 亚洲精品第一国产综合境外资源| 国产黄色免费观看| 国产成人精品日本亚洲| 最刺激黄a大片免费网站| 亚洲国产成a人v在线观看| 免费网站看v片在线香蕉| 美国免费高清一级毛片| 在线观看亚洲成人| 777成影片免费观看| 在线综合亚洲欧洲综合网站 | 久久亚洲精品国产亚洲老地址| 免费无码精品黄AV电影| 看成年女人免费午夜视频| 亚洲伊人久久大香线蕉综合图片| 久久国产色AV免费看| 亚洲精品无码专区在线| 国产精品亚洲产品一区二区三区| 久久青草免费91线频观看不卡| 2020年亚洲天天爽天天噜| 亚洲av无码成人精品区在线播放 | 亚洲国产成人影院播放| 国产精品免费观看调教网| 亚洲va精品中文字幕| 亚洲国产精品尤物YW在线观看| 日韩精品内射视频免费观看 | 最近中文字幕大全免费版在线| 亚洲国产激情在线一区| 亚洲中文字幕无码久久精品1 | 中文在线免费视频| 在线a亚洲老鸭窝天堂av高清|