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

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

?? jsonobject.java

?? AJAX基礎編程--源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package org.json;/*Copyright (c) 2002 JSON.orgPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.The Software shall be used for Good, not Evil.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/import java.util.HashMap;import java.util.Iterator;import java.util.Map;import java.util.NoSuchElementException;import java.text.ParseException;/** * A JSONObject is an unordered collection of name/value pairs. Its * external form is a string wrapped in curly braces with colons between the * names and values, and commas between the values and names. The internal form * is an object having get() and opt() methods for accessing the values by name, * and put() methods for adding or replacing values by name. The values can be * any of these types: Boolean, JSONArray, JSONObject, Number, String, or the * JSONObject.NULL object. * <p> * The constructor can convert an external form string into an internal form * Java object. The toString() method creates an external form string. * <p> * A get() method returns a value if one can be found, and throws an exception * if one cannot be found. An opt() method returns a default value instead of * throwing an exception, and so is useful for obtaining optional values. * <p> * The generic get() and opt() methods return an object, which you can cast or * query for type. There are also typed get() and opt() methods that do type * checking and type coersion for you. * <p> * The texts produced by the toString() methods are very strict. * The constructors are more forgiving in the texts they will accept: * <ul> * <li>An extra <code>,</code>&nbsp;<small>(comma)</small> may appear just  * 	   before the closing brace.</li> * <li>Strings may be quoted with <code>'</code>&nbsp;<small>(single  *     quote)</small>.</li> * <li>Strings do not need to be quoted at all if they do not begin with a quote *     or single quote, and if they do not contain leading or trailing spaces,  *     and if they do not contain any of these characters: *     <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers *     and if they are not the reserved words <code>true</code>,  *     <code>false</code>, or <code>null</code>.</li> * <li>Keys can be followed by <code>=</code> or <code>=></code> as well as  *     by <code>:</code></li> * <li>Values can be followed by <code>;</code> as well as by <code>,</code></li> * <li>Numbers may have the <code>0-</code> <small>(octal)</small> or  *     <code>0x-</code> <small>(hex)</small> prefix.</li>  * <li>Line comments can begin with <code>#</code></li> * </ul> * @author JSON.org * @version 1 */public class JSONObject {    /**     * JSONObject.NULL is equivalent to the value that JavaScript calls null,     * whilst Java's null is equivalent to the value that JavaScript calls     * undefined.     */     private static final class Null {        /**         * Make a Null object.         */        private Null() {        }        /**         * There is only intended to be a single instance of the NULL object,         * so the clone method returns itself.         * @return     NULL.         */        protected final Object clone() {            return this;        }        /**         * A Null object is equal to the null value and to itself.         * @param object    An object to test for nullness.         * @return true if the object parameter is the JSONObject.NULL object         *  or null.         */        public boolean equals(Object object) {            return object == null || object == this;        }        /**         * Get the "null" string value.         * @return The string "null".         */        public String toString() {            return "null";        }    }    /**     * The hash map where the JSONObject's properties are kept.     */    private HashMap myHashMap;    /**     * It is sometimes more convenient and less ambiguous to have a NULL     * object than to use Java's null value.     * JSONObject.NULL.equals(null) returns true.     * JSONObject.NULL.toString() returns "null".     */    public static final Object NULL = new Null();    /**     * Construct an empty JSONObject.     */    public JSONObject() {        myHashMap = new HashMap();    }    /**     * Construct a JSONObject from a JSONTokener.     * @throws ParseException if there is a syntax error in the source string.     * @param x A JSONTokener object containing the source string.     */    public JSONObject(JSONTokener x) throws ParseException {        this();        char c;        String key;        if (x.nextClean() != '{') {            throw x.syntaxError("A JSONObject must begin with '{'");        }        while (true) {            c = x.nextClean();            switch (c) {            case 0:                throw x.syntaxError("A JSONObject must end with '}'");            case '}':                return;            default:                x.back();                key = x.nextValue().toString();            }            c = x.nextClean();			if (c == '=') {				if (x.next() != '>') {					x.back();				}			} else if (c != ':') {                throw x.syntaxError("Expected a ':' after a key");            }            myHashMap.put(key, x.nextValue());            switch (x.nextClean()) {			case ';':            case ',':                if (x.nextClean() == '}') {                    return;                }                x.back();                break;            case '}':                return;            default:                throw x.syntaxError("Expected a ',' or '}'");            }        }    }    /**     * Construct a JSONObject from a string.     * @exception ParseException The string must be properly formatted.     * @param string    A string beginning      *  with <code>{</code>&nbsp;<small>(left brace)</small> and ending      *  with <code>}</code>&nbsp;<small>(right brace)</small>.     */    public JSONObject(String string) throws ParseException {        this(new JSONTokener(string));    }    /**     * Construct a JSONObject from a Map.     * @param map A map object that can be used to initialize the contents of     *  the JSONObject.     */    public JSONObject(Map map) {        myHashMap = new HashMap(map);    }    /**     * Accumulate values under a key. It is similar to the put method except     * that if there is already an object stored under the key then a     * JSONArray is stored under the key to hold all of the accumulated values.     * If there is already a JSONArray, then the new value is appended to it.     * In contrast, the put method replaces the previous value.     * @throws NullPointerException if the key is null     * @param key   A key string.     * @param value An object to be accumulated under the key.     * @return this.     */    public JSONObject accumulate(String key, Object value)            throws NullPointerException {        JSONArray a;        Object o = opt(key);        if (o == null) {            put(key, value);        } else if (o instanceof JSONArray) {            a = (JSONArray)o;            a.put(value);        } else {            a = new JSONArray();            a.put(o);            a.put(value);            put(key, a);        }        return this;    }    /**     * Get the value object associated with a key.     * @exception NoSuchElementException if the key is not found.     *     * @param key   A key string.     * @return      The object associated with the key.     */    public Object get(String key) throws NoSuchElementException {        Object o = opt(key);        if (o == null) {            throw new NoSuchElementException("JSONObject[" +                quote(key) + "] not found.");        }        return o;    }    /**     * Get the boolean value associated with a key.     * @exception NoSuchElementException if the key is not found.     * @exception ClassCastException     *  if the value is not a Boolean or the String "true" or "false".     *     * @param key   A key string.     * @return      The truth.     */    public boolean getBoolean(String key)            throws ClassCastException, NoSuchElementException {        Object o = get(key);        if (o == Boolean.FALSE || 				(o instanceof String && 				((String)o).equalsIgnoreCase("false"))) {            return false;        } else if (o == Boolean.TRUE || 				(o instanceof String && 				((String)o).equalsIgnoreCase("true"))) {            return true;        }        throw new ClassCastException("JSONObject[" +            quote(key) + "] is not a Boolean.");    }    /**     * Get the double value associated with a key.     * @exception NoSuchElementException if the key is not found or     *  if the value is a Number object.     * @exception NumberFormatException if the value cannot be converted to a     *  number.     * @param key   A key string.     * @return      The numeric value.     */    public double getDouble(String key)            throws NoSuchElementException, NumberFormatException {        Object o = get(key);        if (o instanceof Number) {            return ((Number)o).doubleValue();        }        if (o instanceof String) {            return new Double((String)o).doubleValue();        }        throw new NumberFormatException("JSONObject[" +            quote(key) + "] is not a number.");    }    /**     * Get the HashMap the holds that contents of the JSONObject.     * @return The getHashMap.     */     HashMap getHashMap() {        return myHashMap;     }    /**     * Get the int value associated with a key.     * @exception NoSuchElementException if the key is not found     * @exception NumberFormatException     *  if the value cannot be converted to a number.     *     * @param key   A key string.     * @return      The integer value.     */    public int getInt(String key)            throws NoSuchElementException, NumberFormatException {        Object o = get(key);        if (o instanceof Number) {            return ((Number)o).intValue();        }        return (int)getDouble(key);    }    /**     * Get the JSONArray value associated with a key.     * @exception NoSuchElementException if the key is not found or     *  if the value is not a JSONArray.     *     * @param key   A key string.     * @return      A JSONArray which is the value.     */    public JSONArray getJSONArray(String key) throws NoSuchElementException {        Object o = get(key);        if (o instanceof JSONArray) {            return (JSONArray)o;        }        throw new NoSuchElementException("JSONObject[" +            quote(key) + "] is not a JSONArray.");    }    /**     * Get the JSONObject value associated with a key.     * @exception NoSuchElementException if the key is not found or     *  if the value is not a JSONObject.     *     * @param key   A key string.     * @return      A JSONObject which is the value.     */    public JSONObject getJSONObject(String key) throws NoSuchElementException {        Object o = get(key);        if (o instanceof JSONObject) {            return (JSONObject)o;        }        throw new NoSuchElementException("JSONObject[" +            quote(key) + "] is not a JSONObject.");    }    /**     * Get the string associated with a key.     * @exception NoSuchElementException if the key is not found.     *     * @param key   A key string.     * @return      A string which is the value.     */    public String getString(String key) throws NoSuchElementException {        return get(key).toString();    }    /**     * Determine if the JSONObject contains a specific key.     * @param key   A key string.     * @return      true if the key exists in the JSONObject.     */    public boolean has(String key) {        return myHashMap.containsKey(key);    }    /**     * Determine if the value associated with the key is null or if there is     *  no value.     * @param key   A key string.     * @return      true if there is no value associated with the key or if     *  the value is the JSONObject.NULL object.     */    public boolean isNull(String key) {        return JSONObject.NULL.equals(opt(key));    }    /**     * Get an enumeration of the keys of the JSONObject.     *     * @return An iterator of the keys.     */    public Iterator keys() {        return myHashMap.keySet().iterator();    }    /**     * Get the number of keys stored in the JSONObject.     *     * @return The number of keys in the JSONObject.     */    public int length() {        return myHashMap.size();    }    /**     * Produce a JSONArray containing the names of the elements of this     * JSONObject.     * @return A JSONArray containing the key strings, or null if the JSONObject     * is empty.     */    public JSONArray names() {        JSONArray ja = new JSONArray();        Iterator  keys = keys();        while (keys.hasNext()) {            ja.put(keys.next());        }        if (ja.length() == 0) {            return null;        }        return ja;    }    /**     * Produce a string from a number.     * @exception ArithmeticException JSON can only serialize finite numbers.     * @param  n A Number     * @return A String.     */    static public String numberToString(Number n) throws ArithmeticException {        if (                (n instanceof Float &&                    (((Float)n).isInfinite() || ((Float)n).isNaN())) ||                (n instanceof Double &&                    (((Double)n).isInfinite() || ((Double)n).isNaN()))) {            throw new ArithmeticException(                "JSON can only serialize finite numbers.");        }// Shave off trailing zeros and decimal point, if possible.        String s = n.toString().toLowerCase();        if (s.indexOf('e') < 0 && s.indexOf('.') > 0) {            while (s.endsWith("0")) {                s = s.substring(0, s.length() - 1);            }            if (s.endsWith(".")) {                s = s.substring(0, s.length() - 1);            }        }        return s;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品美女一区二区| 午夜av电影一区| 欧美激情中文不卡| 久久久久久久综合| 欧美精品一区男女天堂| 日韩欧美一级在线播放| 欧美日韩免费观看一区二区三区| 色综合中文字幕国产 | 精品国产乱码久久久久久影片| 正在播放亚洲一区| 日韩一二在线观看| 精品嫩草影院久久| 国产精品网站一区| 亚洲欧美色图小说| 亚洲国产精品精华液网站| 亚洲电影中文字幕在线观看| 亚洲国产精品久久久久秋霞影院| 亚洲国产精品尤物yw在线观看| 婷婷综合另类小说色区| 日韩在线观看一区二区| 精品一区二区影视| 国产一二精品视频| 白白色 亚洲乱淫| 91黄色在线观看| 欧美日本精品一区二区三区| 日韩午夜三级在线| 国产无人区一区二区三区| 国产精品乱码人人做人人爱 | 亚洲免费成人av| 亚洲综合男人的天堂| 午夜精品一区二区三区免费视频| 日韩影院精彩在线| 国产精品影视天天线| 成+人+亚洲+综合天堂| 欧美少妇一区二区| 日韩免费电影一区| 综合自拍亚洲综合图不卡区| 一区二区成人在线视频| 奇米一区二区三区av| 成人午夜免费av| 亚洲美女电影在线| 视频一区在线播放| 国产91精品精华液一区二区三区| 91麻豆6部合集magnet| 欧美久久久久中文字幕| 久久精品亚洲乱码伦伦中文| 一区二区三区美女视频| 黄网站免费久久| 欧美性高清videossexo| 久久精品亚洲麻豆av一区二区| 亚洲精品中文字幕在线观看| 美洲天堂一区二卡三卡四卡视频| 不卡电影免费在线播放一区| 91精品午夜视频| 中文字幕在线观看一区| 日本不卡视频一二三区| www.一区二区| 日韩欧美一级在线播放| 亚洲激情自拍视频| 国产毛片一区二区| 欧美日韩免费视频| 亚洲视频电影在线| 国内精品写真在线观看| 欧美性欧美巨大黑白大战| 国产丝袜欧美中文另类| 日韩国产欧美在线视频| 99re在线精品| 国产亚洲午夜高清国产拍精品| 亚洲va欧美va国产va天堂影院| 国产99精品国产| 欧美精品成人一区二区三区四区| 亚洲视频综合在线| 国产精品一二三四| 欧美大胆人体bbbb| 亚洲成人av一区二区| 波多野洁衣一区| 国产亚洲一区二区三区四区| 美女被吸乳得到大胸91| 欧美日韩成人综合天天影院| 亚洲色欲色欲www| 国产美女精品在线| 欧美一级片在线观看| 亚洲韩国一区二区三区| 99免费精品视频| 中文字幕av资源一区| 韩国v欧美v日本v亚洲v| 欧美一区二区黄色| 午夜精品久久久久久久久久| 在线观看成人小视频| 亚洲欧美国产77777| 不卡一卡二卡三乱码免费网站| 国产午夜精品久久久久久免费视| 蜜桃精品视频在线| 日韩一级高清毛片| 美女视频黄免费的久久 | 精品88久久久久88久久久| 亚洲777理论| 亚洲女同女同女同女同女同69| 国产精品影视网| 久久精品视频免费| 国产一区二区成人久久免费影院| 欧美一级理论性理论a| 午夜久久久久久电影| 欧美伦理电影网| 视频一区二区三区入口| 91精品视频网| 免费一级片91| 欧美成va人片在线观看| 麻豆精品视频在线观看| 日韩你懂的在线观看| 精品一区二区免费视频| 久久亚洲影视婷婷| 国产黄色91视频| 国产精品美女一区二区| 99精品一区二区| 亚洲欧洲成人av每日更新| 91在线看国产| 亚洲国产精品久久一线不卡| 欧美另类高清zo欧美| 日韩综合一区二区| 欧美刺激脚交jootjob| 国产乱码精品一区二区三区忘忧草| 国产亚洲欧洲一区高清在线观看| 国产精品综合二区| 国产精品久久久久国产精品日日| 99精品1区2区| 亚洲国产综合在线| 日韩欧美在线123| 国产成人午夜视频| 亚洲另类色综合网站| 欧美日韩精品一区二区三区| 老司机精品视频线观看86| 国产亚洲精品精华液| 色婷婷国产精品久久包臀 | 在线免费观看日本欧美| 丝袜美腿成人在线| 亚洲精品在线免费观看视频| 成人美女在线视频| 亚洲综合在线第一页| 精品欧美一区二区三区精品久久| 国产91清纯白嫩初高中在线观看| 国产精品久久久久毛片软件| 欧美日韩在线综合| 国产一区二区精品久久| 亚洲激情五月婷婷| 日韩免费性生活视频播放| www.一区二区| 麻豆一区二区三| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美午夜不卡视频| 国产精品18久久久| 亚洲成人在线网站| 国产亚洲人成网站| 欧美日韩国产乱码电影| 国产91丝袜在线观看| 无码av免费一区二区三区试看| 久久精品人人做人人爽人人| 欧美影院午夜播放| 国产91丝袜在线播放0| 日韩在线一区二区三区| 中文字幕欧美一| 精品国产乱码久久久久久浪潮 | 国产欧美日韩激情| 欧美午夜一区二区| 国产91色综合久久免费分享| 天天色天天操综合| 1024精品合集| 精品国产123| 欧美三级蜜桃2在线观看| 国产不卡高清在线观看视频| 肉色丝袜一区二区| 自拍偷自拍亚洲精品播放| 亚洲精品一区二区三区在线观看 | 欧美一区二区在线免费播放 | 久久众筹精品私拍模特| 欧美日韩美少妇| 91麻豆免费视频| 国产盗摄一区二区| 美女国产一区二区| 午夜欧美在线一二页| 亚洲人吸女人奶水| 久久精品人人做人人爽97| 欧美一区二区三区白人| 欧美午夜电影一区| 色综合久久天天| 成人亚洲一区二区一| 韩国视频一区二区| 免播放器亚洲一区| 午夜欧美视频在线观看| 亚洲综合男人的天堂| 亚洲色欲色欲www在线观看| 国产精品视频yy9299一区| 精品理论电影在线| 91精品国产91久久久久久最新毛片 | 国产成人自拍网| 国产真实乱偷精品视频免| 天天av天天翘天天综合网色鬼国产| 亚洲欧美另类综合偷拍| 国产精品剧情在线亚洲| 日本一区二区成人|