亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区夜夜嗨| 亚洲美女屁股眼交| 精品视频在线免费看| 国产伦精品一区二区三区视频青涩 | 一区二区三区蜜桃| 国产精品色哟哟网站| 国产午夜精品久久久久久久| 国产女人18水真多18精品一级做| 精品欧美久久久| 久久久一区二区| 国产精品美女久久久久久| 国产精品美女久久久久av爽李琼 | 成人深夜福利app| 9人人澡人人爽人人精品| 一本色道久久加勒比精品 | 日韩免费看网站| 国产欧美精品国产国产专区| 欧美国产日韩亚洲一区| 亚洲精品第1页| 日日骚欧美日韩| 国产精品一区二区三区网站| 成人妖精视频yjsp地址| 色综合 综合色| 日韩一级二级三级| 国产日产欧美一区二区视频| 亚洲欧美日韩在线| 日韩国产一二三区| 丰满放荡岳乱妇91ww| 在线日韩国产精品| 精品国产免费人成在线观看| 国产精品区一区二区三| 日日夜夜免费精品| av亚洲精华国产精华| 欧美精品一二三| 中文字幕av在线一区二区三区| 亚洲欧美日韩一区二区| 亚洲国产日韩一级| 国产成人精品综合在线观看| 欧美三级一区二区| 久久麻豆一区二区| 亚洲影视在线观看| 精品亚洲porn| 欧美写真视频网站| 欧美国产在线观看| 久久精工是国产品牌吗| 99re成人精品视频| 中文字幕不卡三区| 天天影视色香欲综合网老头| 精品中文字幕一区二区| 色94色欧美sute亚洲线路二 | 免费xxxx性欧美18vr| www.66久久| 久久久亚洲综合| 午夜国产精品一区| 色偷偷88欧美精品久久久| 2020国产成人综合网| 亚洲成av人片| 色婷婷av一区二区三区之一色屋| 国产日韩欧美综合在线| 久久精品国产亚洲高清剧情介绍 | 欧美一区二区三区免费视频| 一区二区三区免费在线观看| 成人免费毛片片v| 久久精品夜夜夜夜久久| 极品瑜伽女神91| 日韩一区二区中文字幕| 亚洲午夜日本在线观看| 91在线看国产| 亚洲欧美偷拍三级| 91日韩精品一区| 亚洲精品免费在线观看| 不卡视频在线看| 中文字幕永久在线不卡| 91在线码无精品| 亚洲欧美另类综合偷拍| 91在线无精精品入口| 亚洲丝袜制服诱惑| 一本久久精品一区二区| 亚洲老妇xxxxxx| 欧美中文字幕一区| 日日夜夜一区二区| 日韩精品一区二区三区视频在线观看 | 日产国产高清一区二区三区| 欧美群妇大交群中文字幕| 午夜在线电影亚洲一区| 欧美一级日韩不卡播放免费| 日韩精品五月天| 久久综合久久综合亚洲| 丁香啪啪综合成人亚洲小说| √…a在线天堂一区| 日本道在线观看一区二区| 亚洲一区二区在线视频| 91精品国产综合久久精品性色 | 亚洲精品一区二区三区影院| 国产精品亚洲专一区二区三区 | 久久亚洲二区三区| 国产精品996| 亚洲免费在线视频| 88在线观看91蜜桃国自产| 国产九色精品成人porny| 国产精品入口麻豆九色| 欧美私模裸体表演在线观看| 免费高清不卡av| 国产精品免费视频观看| 欧美日本不卡视频| 国产91精品入口| 亚洲成人av一区二区| 欧美精品一区二区在线播放| 99热在这里有精品免费| 亚洲成av人片在线观看无码| 久久久久久久久久久久久久久99 | 综合激情网...| 91精品蜜臀在线一区尤物| 成人免费不卡视频| 午夜视频久久久久久| 国产精品色一区二区三区| 欧美日韩的一区二区| 国产不卡高清在线观看视频| 亚洲国产日韩一级| 国产精品进线69影院| 欧美二区乱c少妇| 99麻豆久久久国产精品免费| 麻豆精品久久久| 1024成人网色www| 久久久久久免费网| 欧美猛男超大videosgay| 国产成人一级电影| 男人的天堂亚洲一区| 曰韩精品一区二区| 国产午夜精品一区二区三区视频| 欧美高清视频不卡网| 国产精品亚洲一区二区三区妖精| 日韩精彩视频在线观看| 最新国产精品久久精品| 26uuu成人网一区二区三区| 在线免费观看日本欧美| 粉嫩高潮美女一区二区三区| 一级女性全黄久久生活片免费| 精品人伦一区二区色婷婷| 欧美日韩国产综合视频在线观看 | 久久午夜羞羞影院免费观看| 欧美精品日日鲁夜夜添| 在线观看www91| 91麻豆自制传媒国产之光| 成人污视频在线观看| 国产白丝网站精品污在线入口| 国产原创一区二区三区| 美女视频免费一区| 视频在线观看国产精品| 视频在线观看91| 亚洲尤物在线视频观看| 亚洲黄色尤物视频| 亚洲人一二三区| 一区二区三区欧美| 亚洲一区二区三区在线| 亚洲一区二区精品视频| 亚洲一区欧美一区| 午夜精品久久久久久不卡8050| 亚洲香蕉伊在人在线观| 午夜精品久久久久久久久| 日日夜夜免费精品| 美洲天堂一区二卡三卡四卡视频| 热久久久久久久| 亚洲精品视频自拍| 一区二区三区在线观看网站| 一区二区在线电影| 亚洲第一狼人社区| 国产成人免费视| 色综合婷婷久久| 欧美日韩中文一区| 日韩欧美一二三区| 中文字幕二三区不卡| 国产精品传媒在线| 亚洲va中文字幕| 久色婷婷小香蕉久久| 成人一区二区三区视频在线观看| 99这里只有精品| 精品视频一区二区不卡| 日韩欧美电影一区| 国产精品免费网站在线观看| 一区二区欧美精品| 麻豆精品蜜桃视频网站| 国产一区二区91| 色婷婷亚洲综合| 欧美一级高清片| 中文字幕亚洲区| 日日嗨av一区二区三区四区| 乱一区二区av| 色又黄又爽网站www久久| 日韩午夜精品视频| 国产精品女上位| 玖玖九九国产精品| 91免费观看在线| 日韩欧美一区二区免费| 久久综合五月天婷婷伊人| 亚洲国产精品久久艾草纯爱| 久久国产精品99精品国产| 成人白浆超碰人人人人| 日韩一区二区在线观看视频 | 曰韩精品一区二区|