亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tag.java

?? 中國移動定位引擎的客戶端
?? JAVA
字號:
/**
*
* <p>Title: Smgp協議TLV結構解析</p>
* <p>Description: 標簽描述</p>
* <p>Copyright: Copyright (c) 2007</p>
* <p>Company: 福富軟件</p>
* @author chenxin
* @version 1.0 $Date 2007-07-03
*/

package ffcs.lbp.le.message.tlv;

import java.util.HashMap;
import java.util.Map;



/**
 * Enumeration class for optional parameter tag values.
 * 
 * @author Oran Kelly
 * @version $Id: Tag.java 299 2006-08-10 19:33:16Z orank $
 */
public final class Tag implements java.io.Serializable {

    /**
     * Look-up table of statically defined tags. This <b>must</b> be defined
     * before all the tags as the Tag constructor expects this object to exist.
     */
    private static Map tagTable = new HashMap();

    static final long serialVersionUID = -418561932897398277L;

    public static final Tag IsdnRange = new Tag(0x00000004,String.class,-1);
    public static final Tag Isdn = new Tag(0x00000005,String.class,36);
    public static final Tag ShapeDesc = new Tag(0x0000001D,String.class,-1);



    /**
     * Integer value of this tag.
     */
    private Integer tag;

    /**
     * The minimum length a value of this tag type can be.
     */
    private int minLength = -1;

    /**
     * The maximum length a value of this tag type can be.
     */
    private int maxLength = -1;

    /**
     * The Java type a value of this tag type must be.
     */
    private Class type;

    /**
     * The class used for encoding and decoding values of this tag type.
     * 
     * @see ie.omk.smpp.message.tlv.Encoder
     */
    private Encoder encoder;

    /**
     * Create a new Tag. The encoder type will be chosen from the set of known
     * built-in encoders.
     * 
     * @param tag
     *            The integer value of the tag.
     * @param type
     *            The allowed Java type for the value.
     * @param fixedLength
     *            The fixed length allowed for the value.
     * @throws ie.omk.smpp.message.tlv.TagDefinedException
     *             If a tag with integer value <code>tag</code> has already
     *             been defined.
     */
    private Tag(int tag, Class type, int fixedLength)
            throws TagDefinedException {
        this(tag, type, null, fixedLength, fixedLength);
    }

/*    *//**
     * Create a new Tag. he encoder type will be chosen from the set of known
     * built-in encoders.
     * 
     * @param tag
     *            The integer value of the tag.
     * @param type
     *            The allowed Java type of the value.
     * @param minLength
     *            The minimum length allowed for the value.
     * @param maxLength
     *            The maximum length allowed for the value.
     * @throws ie.omk.smpp.message.tlv.TagDefinedException
     *             If a tag with integer value <code>tag</code> has already
     *             been defined.
     *//*
    private Tag(int tag, Class type, int minLength, int maxLength)
            throws TagDefinedException {
        this(tag, type, null, minLength, maxLength);
    }*/

    /**
     * Create a new Tag.
     * 
     * @param tag
     *            The integer value of the tag.
     * @param type
     *            The allowed Java type for the value
     * @param enc
     *            The encoding class to use to encode and decode values.
     * @param fixedLength
     *            The fixed length allowed for the value.
     * @throws ie.omk.smpp.message.tlv.TagDefinedException
     *             If a tag with integer value <code>tag</code> has already
     *             been defined.
     */
    private Tag(int tag, Class type, Encoder enc, int fixedLength)
            throws TagDefinedException {
        this(tag, type, enc, fixedLength, fixedLength);
    }

    /**
     * Create a new Tag.
     * 
     * @param tag
     *            The integer value of the tag.
     * @param type
     *            The allowed Java type for the value
     * @param enc
     *            The encoding class to use to encode and decode values.
     * @param minLength
     *            The minimum length allowed for the value.
     * @param maxLength
     *            The maximum length allowed for the value.
     * @throws ie.omk.smpp.message.tlv.TagDefinedException
     *             If a tag with integer value <code>tag</code> has already
     *             been defined.
     */
    private Tag(int tag, Class type, Encoder enc, int minLength, int maxLength)
            throws TagDefinedException {
        this.tag = new Integer(tag);
        this.type = type;
        this.minLength = minLength;
        this.maxLength = maxLength;
        if (enc == null) {
            this.encoder = getEncoderForType(type);
        } else {
            this.encoder = enc;
        }

        synchronized (tagTable) {
            if (tagTable.containsKey(this.tag)) {
                throw new TagDefinedException(tag, "Tag 0x"
                        + Integer.toHexString(tag) + " is already defined.");
            }

            tagTable.put(this.tag, this);
        }
    }

    /**
     * Get an <code>Encoder</code> for a particular Java type.
     * 
     * @param type
     *            The Java type to get an encoder for.
     * @return The encoder/decoder for Java type <code>type</code>.
     */
    private Encoder getEncoderForType(Class type) {
        Encoder encoder;
        
        // If type is null and encoder is null, this is a "no value" tlv type.
        if (type == null) {
            encoder = new NullEncoder();
        } else if (java.lang.Number.class.isAssignableFrom(type)) {
            encoder = new NumberEncoder();
        } else if (java.lang.String.class.isAssignableFrom(type)) {
            encoder = new StringEncoder();
        } else if (java.util.BitSet.class.isAssignableFrom(type)) {
            encoder = new BitmaskEncoder();
        } else if (byte[].class.isAssignableFrom(type)) {
            encoder = new OctetEncoder();
        } else {
            throw new NoEncoderException(type, "No encoder for class type "
                    + type.getName());
        }
        return encoder;
    }

    /**
     * Get the integer value of this tag.
     * 
     * @return the integer value of this tag.
     */
    public int intValue() {
        return tag.intValue();
    }

    /**
     * Get the allowed length of a value of this tag type.
     * 
     * @return The allowed length, or the maximum length if a range is set.
     */
    public int getLength() {
        return maxLength < 0 ? minLength : maxLength;
    }

    /**
     * Get the minimum length of a value of this tag type.
     * 
     * @return the minimum length of a value of this tag type.
     */
    public int getMinLength() {
        return minLength;
    }

    /**
     * Get the maximum length of a value of this tag type.
     * 
     * @return the maximum length of a value of this tag type.
     */
    public int getMaxLength() {
        return maxLength;
    }

    /**
     * Get the Java type of values of this tag type.
     * 
     * @return the Java type of values of this tag type.
     */
    public Class getType() {
        return type;
    }

    /**
     * Test for equality. Two tags are equal if their integer values are
     * equivalent.
     * 
     * @return true if <code>obj</code> is Tag and has the same tag value.
     */
    public boolean equals(Object obj) {
        if (obj instanceof Tag) {
            return ((Tag) obj).tag.equals(this.tag);
        } else {
            return false;
        }
    }

    /**
     * Test for equality against an integer.
     * 
     * @return true if this Tag's integer value is equal to <code>tag</code>.
     */
    public boolean equals(int tag) {
        return tag == this.tag.intValue();
    }

    /**
     * Get the hashCode for this Tag. The hashCode for a Tag is the same as:
     * <br>
     * <code>new Integer(tag.tagValue()).hashCode()</code>
     * 
     * @return A hash code for this tag.
     */
    public int hashCode() {
        return tag.hashCode();
    }

    /**
     * Convert this tag to a String. This returns a decimal representation of
     * the tag's integer value in a String.
     * 
     * @return This tag's string value.
     */
    public String toString() {
        return tag.toString();
    }

    /**
     * Convert this tag to a String. This returns a hex representation of the
     * tag's integer value in a String.
     * 
     * @return This tag's hexadecimal representation.
     */
    public String toHexString() {
        return Integer.toHexString(tag.intValue());
    }

    /**
     * Get the encoder used to encode values of this tag type.
     * 
     * @return the encoder used to encode values of this tag type.
     */
    public Encoder getEncoder() {
        return encoder;
    }

    /**
     * Get the Tag object that represents tag <code>tagValue</code>. If the
     * tag is known then the static Tag object representing the tag is returned.
     * If the tag is not known, a fresh instance of Tag will be returned which
     * uses an octet-string type.
     * 
     * <p><b>WARNING</b> The behaviour of this method may change to returning
     * <code>null</code> for an undefined tag. It needs to be determined
     * which behaviour is the best.</p>
     * 
     * @return The Tag object representing the tag <code>tagValue</code>.
     *         Will never return <code>null</code>.
     */
    public static Tag getTag(int tagValue) {
        Tag t = (Tag) tagTable.get(new Integer(tagValue));
        if (t == null) {
            return Tag.defineTag(tagValue, byte[].class, null, -1, -1);
        } else {
            return t;
        }
    }

    /**
     * Define a new tag type which has a fixed length.
     * @param tagValue
     *            the integer value of the tag.
     * @param type
     *            the parameter type.
     * @param enc
     *            the encoder used to serialize and deserialize. This may be
     *            null to use the API's default internally defined encoders.
     * @param fixedSize
     *            the defined size of the parameter.
     * @throws ie.omk.smpp.message.tlv.TagDefinedException
     *             if an attempt is made to define a tag with a integer value
     *             equivalent to an already defined tag.
     * @see Encoder
     */
    public static Tag defineTag(int tagValue, Class type, Encoder enc,
            int fixedSize) throws TagDefinedException {
        return new Tag(tagValue, type, enc, fixedSize);
    }

    /**
     * Define a new tag type with minimum and maximum sizes.
     * @param tagValue
     *            the integer value of the tag.
     * @param type
     *            the parameter type.
     * @param enc
     *            the encoder used to serialize and deserialize. This may be
     *            null to use the API's default internally defined encoders.
     * @param minSize
     *            the minimum size of the parameter.
     * @param maxSize
     *            the maximum size of the parameter.
     * @throws ie.omk.smpp.message.tlv.TagDefinedException
     *             if an attempt is made to define a tag with a integer value
     *             equivalent to an already defined tag.
     * @see Encoder
     */
    public static Tag defineTag(int tagValue, Class type, Encoder enc,
            int minSize, int maxSize) throws TagDefinedException {
        return new Tag(tagValue, type, enc, minSize, maxSize);
    }

    /**
     * Determine if a tag is defined for a particular tag integer value. 
     * @param tagValue The integer value of the tag.
     * @return <code>true</code> if the tag is defined, <code>false</code>
     * otherwise.
     */
    public static boolean isTagDefined(int tagValue) {
        return tagTable.containsKey(new Integer(tagValue));
    }
    
    /**
     * Undefine a tag. This removes all knoweledge of this tag type from the
     * internal tables. If there is no such tag defined already, this method
     * will do nothing.
     * 
     * @param tag
     *            The tag to undefine. null if there was no tag defined already.
     * @return The Tag object that has been undefined.
     */
    public static Tag undefineTag(Tag tag) {
        if (tag == null) {
            return null;
        }
        synchronized (tagTable) {
            return (Tag) tagTable.remove(tag.tag);
        }
    }
    public static String checkTag(int tag){
    	switch (tag) {
    	case 0x00000004: return "IsdnRange:";     
    	case 0x00000005: return "Isdn:";     
    	case 0x0000001D: return "ShapeDesc:";          
       	default: return "not known tag name";
    	}
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜理伦三级在线观看| 亚洲精品在线网站| 日韩欧美在线不卡| 中文一区一区三区高中清不卡| 亚洲美女屁股眼交| 国产一区二区三区免费看| 97精品超碰一区二区三区| 欧美tickling挠脚心丨vk| 中文字幕欧美一| 久久疯狂做爰流白浆xx| 色香色香欲天天天影视综合网| 日韩欧美国产电影| 亚洲gay无套男同| youjizz国产精品| 亚洲精品一区二区三区四区高清 | 色哟哟精品一区| 26uuu国产电影一区二区| 亚洲夂夂婷婷色拍ww47| 国产精品一区二区在线播放 | 日韩视频免费观看高清完整版在线观看 | av在线免费不卡| 亚洲精品一区二区精华| 五月天欧美精品| 欧美三片在线视频观看| 国产精品色呦呦| 成人在线视频首页| 国产日韩欧美在线一区| 久久99热国产| 日韩欧美精品在线| 日韩电影免费一区| 91麻豆精品国产自产在线观看一区 | 日韩伦理免费电影| 国产**成人网毛片九色| 久久久精品中文字幕麻豆发布| 美女诱惑一区二区| 欧美一区二区三区视频免费播放| 伊人开心综合网| 色偷偷88欧美精品久久久| 亚洲欧洲一区二区在线播放| 国产河南妇女毛片精品久久久| 欧美mv日韩mv国产网站app| 天天操天天干天天综合网| 欧美日韩一级二级三级| 五月天精品一区二区三区| 欧美日本在线看| 青青青伊人色综合久久| 欧美一区二区在线播放| 韩国成人在线视频| 国产日韩欧美精品电影三级在线| 国产成人午夜视频| ...中文天堂在线一区| av成人免费在线观看| 亚洲美女屁股眼交3| 欧美日韩国产大片| 免费观看日韩av| 久久免费视频一区| 99re视频这里只有精品| 午夜精品久久久久久久久久| 日韩欧美卡一卡二| 成人av在线资源网站| 一区av在线播放| 日韩色视频在线观看| 成人免费看视频| 亚洲成人激情综合网| 337p粉嫩大胆噜噜噜噜噜91av| 国产精品一区不卡| www日韩大片| 国产精品一区二区你懂的| 亚洲图片你懂的| 色哟哟日韩精品| 日韩黄色在线观看| 久久综合久久鬼色中文字| 国产成人av一区二区三区在线 | www激情久久| 国产jizzjizz一区二区| 国产精品久久毛片av大全日韩| 日韩国产欧美在线播放| 精品国产免费人成在线观看| 国产成人日日夜夜| 亚洲人成精品久久久久| 欧美精品日韩一本| 国产精品一区二区在线观看不卡 | 欧美一区二区三区四区久久| 裸体一区二区三区| 国产欧美久久久精品影院| 日本高清免费不卡视频| 蜜臂av日日欢夜夜爽一区| 欧美国产精品一区二区三区| 91福利视频网站| 国内久久婷婷综合| 亚洲欧美激情插| 日韩一区二区在线观看视频| 日日夜夜精品视频天天综合网| 国产精品国产自产拍在线| 欧美日韩国产高清一区二区三区| 国产精一区二区三区| 亚洲制服丝袜一区| 国产欧美日产一区| 欧美一区二区三区在线| av不卡免费电影| 日本成人中文字幕在线视频| 中文字幕不卡的av| 欧美一区二区三区免费大片| 91福利国产成人精品照片| 国产米奇在线777精品观看| 一区二区三区鲁丝不卡| 精品国产sm最大网站| 欧美色图12p| 成人动漫在线一区| 蜜桃av噜噜一区二区三区小说| 欧美v国产在线一区二区三区| 欧美视频自拍偷拍| 99在线精品免费| 精品一区二区三区在线播放| 亚洲自拍偷拍欧美| 亚洲三级电影网站| 国产精品欧美久久久久无广告 | 高清在线成人网| 久久国产精品99精品国产| 一区二区三区免费网站| 亚洲欧美中日韩| 精品国产一区二区精华| 欧美日韩不卡一区| 欧美无人高清视频在线观看| 成人av网站在线观看免费| 久久精品国产亚洲a| 亚洲一区二区视频在线观看| 国产视频视频一区| 欧美精品一区二区精品网| 欧亚一区二区三区| 日本电影欧美片| 色综合 综合色| 国产精品99久久不卡二区| 麻豆精品在线视频| 日av在线不卡| 国产福利一区二区三区在线视频| 天涯成人国产亚洲精品一区av| 亚洲欧美另类在线| 亚洲乱码国产乱码精品精98午夜| 国产女人水真多18毛片18精品视频| 中文字幕国产一区二区| 国产日韩精品视频一区| 国产色产综合产在线视频| 久久精品免费在线观看| 中文字幕巨乱亚洲| 中文字幕亚洲区| 自拍偷拍亚洲综合| 亚洲在线观看免费视频| 亚洲成av人片| 美日韩一级片在线观看| 国内外精品视频| 成人国产精品免费观看动漫| 99久久国产综合精品色伊| 色www精品视频在线观看| 在线观看国产日韩| 欧美一区二区性放荡片| 26uuu久久综合| 国产精品你懂的| 亚洲高清免费视频| 国产精品伦一区二区三级视频| 一区二区三区欧美日韩| 日韩二区三区四区| 国产精品一区二区在线播放| 国产精品自拍av| 色综合一区二区| 欧美精三区欧美精三区| 久久在线免费观看| 中文字幕在线不卡国产视频| 亚洲日本青草视频在线怡红院 | 国产成人高清视频| 91视视频在线观看入口直接观看www | 久久久三级国产网站| 亚洲欧洲日韩综合一区二区| 亚洲欧美另类综合偷拍| 久久99久久99| 91视视频在线观看入口直接观看www | 亚洲高清免费观看| 精品一区二区久久| 成人av影院在线| 91精品国模一区二区三区| 久久亚洲一区二区三区四区| 亚洲人成伊人成综合网小说| 奇米精品一区二区三区四区| 日日夜夜一区二区| 亚洲五月六月丁香激情| 国产精品99久久久久| 粉嫩13p一区二区三区| 在线综合+亚洲+欧美中文字幕| 欧美激情一区二区三区不卡| 一区二区在线观看不卡| 久久爱www久久做| 欧美少妇性性性| 国产精品国产三级国产| 蜜桃av一区二区三区电影| 91福利在线播放| 国产精品素人一区二区| 久久66热偷产精品| 欧美一区二区成人| 亚洲一区二区欧美激情| 99久久久精品|