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

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

?? jsonarray.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.text.ParseException;import java.util.ArrayList;import java.util.Collection;import java.util.NoSuchElementException;/** * A JSONArray is an ordered sequence of values. Its external form is a string * wrapped in square brackets with commas between the values. The internal form * is an object having get() and opt() methods for accessing the values by * index, and put() methods for adding or replacing values. The values can be * any of these types: Boolean, JSONArray, JSONObject, Number, String, or the * JSONObject.NULL object. * <p> * The constructor can convert a JSON 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 typing * 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 bracket.</li> * <li>The null value will be inserted when there  *     is <code>,</code>&nbsp;<small>(comma)</small> elision.</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>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 JSONArray {    /**     * The getArrayList where the JSONArray's properties are kept.     */    private ArrayList myArrayList;    /**     * Construct an empty JSONArray.     */    public JSONArray() {        myArrayList = new ArrayList();    }    /**     * Construct a JSONArray from a JSONTokener.     * @exception ParseException A JSONArray must start with '['     * @exception ParseException Expected a ',' or ']'     * @param x A JSONTokener     */    public JSONArray(JSONTokener x) throws ParseException {        this();        if (x.nextClean() != '[') {            throw x.syntaxError("A JSONArray must start with '['");        }        if (x.nextClean() == ']') {            return;        }        x.back();        while (true) {            if (x.nextClean() == ',') {                x.back();                myArrayList.add(null);            } else {                x.back();                myArrayList.add(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 JSONArray from a source string.     * @exception ParseException The string must conform to JSON syntax.     * @param string     A string that begins with      * <code>[</code>&nbsp;<small>(left bracket)</small>     *  and ends with <code>]</code>&nbsp;<small>(right bracket)</small>.     */    public JSONArray(String string) throws ParseException {        this(new JSONTokener(string));    }    /**     * Construct a JSONArray from a Collection.     * @param collection     A Collection.     */    public JSONArray(Collection collection) {        myArrayList = new ArrayList(collection);    }    /**     * Get the object value associated with an index.     * @exception NoSuchElementException     * @param index      *  The index must be between 0 and length() - 1.     * @return An object value.     */    public Object get(int index) throws NoSuchElementException {        Object o = opt(index);        if (o == null) {            throw new NoSuchElementException("JSONArray[" + index +                "] not found.");        }        return o;    }    /**     * Get the ArrayList which is holding the elements of the JSONArray.     * @return      The ArrayList.     */    ArrayList getArrayList() {        return myArrayList;    }    /**     * Get the boolean value associated with an index.     * The string values "true" and "false" are converted to boolean.     *     * @exception NoSuchElementException if the index is not found     * @exception ClassCastException     * @param index The index must be between 0 and length() - 1.     * @return      The truth.     */    public boolean getBoolean(int index)            throws ClassCastException, NoSuchElementException {        Object o = get(index);        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("JSONArray[" + index +            "] not a Boolean.");    }    /**     * Get the double value associated with an index.     * @exception NoSuchElementException if the key is not found     * @exception NumberFormatException     *  if the value cannot be converted to a number.     *     * @param index The index must be between 0 and length() - 1.     * @return      The value.     */    public double getDouble(int index)            throws NoSuchElementException, NumberFormatException {        Object o = get(index);        if (o instanceof Number) {            return ((Number) o).doubleValue();        }        if (o instanceof String) {            return new Double((String)o).doubleValue();        }        throw new NumberFormatException("JSONObject[" +            index + "] is not a number.");    }    /**     * Get the int value associated with an index.     * @exception NoSuchElementException if the key is not found     * @exception NumberFormatException     *  if the value cannot be converted to a number.     *     * @param index The index must be between 0 and length() - 1.     * @return      The value.     */    public int getInt(int index)            throws NoSuchElementException, NumberFormatException {        Object o = get(index);        if (o instanceof Number) {            return ((Number)o).intValue();        }        return (int)getDouble(index);    }    /**     * Get the JSONArray associated with an index.     * @exception NoSuchElementException if the index is not found or if the     * value is not a JSONArray     * @param index The index must be between 0 and length() - 1.     * @return      A JSONArray value.     */    public JSONArray getJSONArray(int index) throws NoSuchElementException {        Object o = get(index);        if (o instanceof JSONArray) {            return (JSONArray)o;        }        throw new NoSuchElementException("JSONArray[" + index +                "] is not a JSONArray.");    }    /**     * Get the JSONObject associated with an index.     * @exception NoSuchElementException if the index is not found or if the     * value is not a JSONObject     * @param index subscript     * @return      A JSONObject value.     */    public JSONObject getJSONObject(int index) throws NoSuchElementException {        Object o = get(index);        if (o instanceof JSONObject) {            return (JSONObject)o;        }        throw new NoSuchElementException("JSONArray[" + index +            "] is not a JSONObject.");    }    /**     * Get the string associated with an index.     * @exception NoSuchElementException     * @param index The index must be between 0 and length() - 1.     * @return      A string value.     */    public String getString(int index) throws NoSuchElementException {        return get(index).toString();    }    /**     * Determine if the value is null.     * @param index The index must be between 0 and length() - 1.     * @return true if the value at the index is null, or if there is no value.     */    public boolean isNull(int index) {        Object o = opt(index);        return o == null || o.equals(null);    }    /**     * Make a string from the contents of this JSONArray. The separator string     * is inserted between each element.     * Warning: This method assumes that the data structure is acyclical.     * @param separator A string that will be inserted between the elements.     * @return a string.     */    public String join(String separator) {        int i;        Object o;        StringBuffer sb = new StringBuffer();        for (i = 0; i < myArrayList.size(); i += 1) {            if (i > 0) {                sb.append(separator);            }            o = myArrayList.get(i);            if (o == null) {                sb.append("null");            } else if (o instanceof String) {                sb.append(JSONObject.quote((String)o));            } else if (o instanceof Number) {                sb.append(JSONObject.numberToString((Number)o));            } else {                sb.append(o.toString());            }        }        return sb.toString();    }    /**     * Get the length of the JSONArray.     *     * @return The length (or size).     */    public int length() {        return myArrayList.size();    }    /**     * Get the optional object value associated with an index.     * @param index The index must be between 0 and length() - 1.     * @return      An object value, or null if there is no     *              object at that index.     */    public Object opt(int index) {        if (index < 0 || index >= length()) {            return null;        } else {            return myArrayList.get(index);        }    }    /**     * Get the optional boolean value associated with an index.     * It returns false if there is no value at that index,     * or if the value is not Boolean.TRUE or the String "true".     *     * @param index The index must be between 0 and length() - 1.     * @return      The truth.     */    public boolean optBoolean(int index)  {        return optBoolean(index, false);    }    /**     * Get the optional boolean value associated with an index.     * It returns the defaultValue if there is no value at that index or if it is not     * a Boolean or the String "true" or "false" (case insensitive).     *     * @param index The index must be between 0 and length() - 1.     * @param defaultValue     A boolean default.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产aⅴ原创 | 激情伊人五月天久久综合| 精品盗摄一区二区三区| 91麻豆福利精品推荐| 久久精品99国产精品日本| 亚洲精品欧美二区三区中文字幕| 色哟哟欧美精品| 精品一区二区三区av| 亚洲日本乱码在线观看| 久久青草欧美一区二区三区| 欧美影院一区二区三区| caoporn国产精品| 九色|91porny| 日日夜夜精品视频天天综合网| 中文字幕国产一区| 久久综合色播五月| 777精品伊人久久久久大香线蕉| 成人网男人的天堂| 久久99国产精品久久99果冻传媒| 一个色综合网站| 国产精品久久久久久久蜜臀| 日韩美女视频在线| 91麻豆精品国产91久久久| 色呦呦网站一区| 国产a区久久久| 韩国成人在线视频| 日韩福利视频导航| 亚洲成在人线免费| 亚洲一区二区三区四区的| 亚洲欧洲日本在线| 国产精品萝li| 久久午夜老司机| 精品国产乱码久久久久久免费| 91精品国产欧美日韩| 欧美人妖巨大在线| 欧美日韩中文字幕一区| 欧洲av一区二区嗯嗯嗯啊| 色域天天综合网| 色吧成人激情小说| 色94色欧美sute亚洲13| 色丁香久综合在线久综合在线观看| 北条麻妃一区二区三区| 成人国产一区二区三区精品| 成人免费黄色大片| 成人av网站在线观看| www.亚洲人| 91丨porny丨最新| 91毛片在线观看| 欧美综合一区二区三区| 91福利国产成人精品照片| 欧美无砖砖区免费| 欧美精三区欧美精三区| 欧美高清一级片在线| 欧美一二三在线| 精品久久久久av影院| 国产午夜精品福利| 国产精品久久免费看| 亚洲乱码国产乱码精品精98午夜| 一区二区三区中文字幕精品精品| 一区二区三区av电影| 婷婷国产在线综合| 极品少妇xxxx精品少妇| 国产大陆亚洲精品国产| a级高清视频欧美日韩| 色哟哟一区二区在线观看| 欧美夫妻性生活| 精品99一区二区| 中文字幕色av一区二区三区| 一区二区三区成人| 久久精品国产成人一区二区三区| 国产成人av影院| 99久久国产综合精品麻豆| 欧洲一区二区三区在线| 日韩女优av电影| 中文av一区特黄| 亚洲大片精品永久免费| 极品尤物av久久免费看| 99在线精品免费| 欧美日韩国产综合一区二区| 欧美v国产在线一区二区三区| 国产日韩欧美a| 午夜成人免费视频| 国产一区二三区| 在线视频欧美精品| 欧美va日韩va| 亚洲色图视频网| 麻豆一区二区99久久久久| 成人免费视频视频在线观看免费| 欧美日韩一区二区欧美激情 | 国产精品伦理一区二区| 亚洲123区在线观看| 国产精品99久久久久久久女警 | 亚洲伊人伊色伊影伊综合网| 欧美午夜宅男影院| 在线成人免费观看| 日韩欧美卡一卡二| 亚洲四区在线观看| 亚洲18影院在线观看| 国产·精品毛片| 欧美日韩一区二区不卡| 26uuu亚洲婷婷狠狠天堂| 亚洲精品一二三四区| 日韩国产在线一| 国产乱码字幕精品高清av | 欧美日韩亚洲国产综合| 亚洲国产精品99久久久久久久久| 五月激情六月综合| www.亚洲人| 久久精品一区二区三区av| 亚洲国产精品尤物yw在线观看| 国产91丝袜在线播放0| 欧美日韩一卡二卡| 亚洲欧美国产毛片在线| 国产一区二区三区免费在线观看| 欧美日韩日日夜夜| 欧美国产日韩精品免费观看| 麻豆高清免费国产一区| 色综合天天视频在线观看| 91麻豆精品国产综合久久久久久 | 91精品国产一区二区三区香蕉| 亚洲色图欧洲色图婷婷| 国产在线播精品第三| 日韩欧美一区二区免费| 亚洲一区在线观看免费观看电影高清| av午夜一区麻豆| 久久亚洲一区二区三区四区| 捆绑调教美女网站视频一区| 在线国产亚洲欧美| 亚洲精品久久久蜜桃| 粉嫩蜜臀av国产精品网站| 久久综合九色综合欧美就去吻| 一区2区3区在线看| 欧美视频在线一区| 亚洲欧洲99久久| 成人aa视频在线观看| 欧美精品一区二区三区久久久| 午夜精品aaa| 在线91免费看| 视频一区二区中文字幕| 91麻豆精品久久久久蜜臀| 亚洲超丰满肉感bbw| 欧美日韩久久一区二区| 一区二区三区在线观看欧美| 91成人在线精品| 亚洲一区欧美一区| 69p69国产精品| 天天做天天摸天天爽国产一区| 3d动漫精品啪啪| 日日噜噜夜夜狠狠视频欧美人| 欧美一区二区三区四区高清| 亚洲最大的成人av| 制服丝袜在线91| 亚洲第四色夜色| 欧美日韩高清一区二区不卡| 日本成人超碰在线观看| 在线播放日韩导航| 国产主播一区二区| 国产欧美日韩视频一区二区| 99久久综合色| 亚洲美女免费视频| 91精品国产欧美日韩| 捆绑调教一区二区三区| 国产精品美女久久久久高潮| 97se狠狠狠综合亚洲狠狠| 一区二区三区在线免费视频| 51精品秘密在线观看| 久久狠狠亚洲综合| 中文字幕在线视频一区| 99国产精品一区| 日本午夜精品视频在线观看| 日韩欧美中文字幕精品| 成人免费av资源| 亚洲午夜激情网页| 日韩欧美电影一区| 97精品久久久久中文字幕| 亚洲一区二区三区爽爽爽爽爽 | 精品一区二区三区不卡| 国产精品的网站| 欧美日韩一级片在线观看| 麻豆成人91精品二区三区| 国产精品久久久久aaaa| 欧美自拍丝袜亚洲| 国产麻豆精品一区二区| 国产精品欧美一区二区三区| 欧美精品乱码久久久久久按摩| 日本aⅴ精品一区二区三区| 国产精品伦理一区二区| 国产成a人亚洲精品| 午夜精品久久久| 中文字幕+乱码+中文字幕一区| 日本道色综合久久| 国产河南妇女毛片精品久久久 | 2020国产精品| 精品视频123区在线观看| 激情图片小说一区| 丝袜美腿亚洲色图| 2023国产精品| 51精品国自产在线| 色婷婷久久久综合中文字幕| 国内偷窥港台综合视频在线播放|