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

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

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

    無線&移動互聯網技術研發

    換位思考·····
    posts - 19, comments - 53, trackbacks - 0, articles - 283
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    手機號碼驗證---(摘)

    Posted on 2009-06-28 13:33 Gavin.lee 閱讀(567) 評論(0)  編輯  收藏 所屬分類: java SE & EE
    package com.Gavin.tools.util;

    /**
     * **********************************************
     * @description 判斷手機號碼
     * 
    @author Gavin.lee
     * @date Jun 28, 2009    4:57:26 AM
     * 
    @version 1.0
     ***********************************************
     
    */

    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(",")
            .append(
    "facilitatorType:").append(this.getFacilitatorType()).append(",")
            .append(
    "isLawful:").append(this.isLawful()).append(",")
            .append(
    "is3G:").append(this.isIs3G()).append(";");
            
    return str.toString();
        }


        
    public static void main(String[] args) {
            Mobile mobile 
    = new Mobile("13088817413");
            System.out.println(mobile.toString());
        }

    }

    主站蜘蛛池模板: 成人爱做日本视频免费| 日本最新免费网站| 亚洲电影日韩精品| 日韩色日韩视频亚洲网站| 西西大胆无码视频免费| 精品国产成人亚洲午夜福利| 在线观看成人免费视频不卡| 亚洲午夜精品一区二区公牛电影院 | 免费一级全黄少妇性色生活片 | 久久亚洲色一区二区三区| 免费人成大片在线观看播放电影 | 国产亚洲综合网曝门系列| 久久www免费人成精品香蕉| 亚洲日韩欧洲无码av夜夜摸| 不卡视频免费在线观看| 亚洲AV无码久久寂寞少妇| 131美女爱做免费毛片| 国产精品久久亚洲不卡动漫| 日韩成人在线免费视频| 国产亚洲女在线线精品| 久久精品国产精品亚洲| 岛国岛国免费V片在线观看| 久热综合在线亚洲精品| 无人在线直播免费观看| 欧美亚洲国产SUV| 久久久久亚洲AV综合波多野结衣 | 亚洲人AV在线无码影院观看| 国产午夜免费福利红片| 国产在线观看无码免费视频| 亚洲天堂在线播放| 黄色成人网站免费无码av| 国产亚洲精品仙踪林在线播放| 国产亚洲色视频在线| 91久久青青草原线免费| 亚洲国产欧美国产综合一区| 国产亚洲精品国看不卡| 国产在线观看麻豆91精品免费| 国产精品亚洲综合网站| 亚洲AV天天做在线观看| 无码国模国产在线观看免费| 久久中文字幕免费视频|