亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
洋洋av久久久久久久一区| 东方aⅴ免费观看久久av| 亚洲美女偷拍久久| 综合色中文字幕| 国产精品久久久久久久蜜臀| 国产午夜精品一区二区三区嫩草| 日韩欧美色电影| 日韩免费观看高清完整版在线观看| 在线观看日韩电影| 欧洲国产伦久久久久久久| 91麻豆免费看| 欧美综合久久久| 欧美日韩高清一区二区三区| 欧美日韩美女一区二区| 91精品国产色综合久久ai换脸 | 欧美老女人第四色| 欧美日韩情趣电影| 日韩午夜激情视频| 久久综合一区二区| 国产亚洲1区2区3区| 国产欧美精品国产国产专区| 欧美国产欧美亚州国产日韩mv天天看完整| 久久久久久久久久电影| 国产精品久久久久一区| 亚洲精品美腿丝袜| 天天亚洲美女在线视频| 精品一区二区三区免费视频| 国产美女视频91| 成+人+亚洲+综合天堂| 91久久久免费一区二区| 欧美精品在线一区二区三区| 欧美一级夜夜爽| 国产亚洲人成网站| 亚洲色欲色欲www| 午夜久久久久久| 老司机精品视频在线| 成人一级视频在线观看| 在线免费精品视频| 日韩欧美美女一区二区三区| 国产无人区一区二区三区| 一区二区三区四区不卡视频| 久久精品国产久精国产爱| 成人av网址在线| 欧美嫩在线观看| 久久久久久久综合色一本| 亚洲男人天堂一区| 免费欧美日韩国产三级电影| 9i在线看片成人免费| 制服丝袜激情欧洲亚洲| 中文字幕乱码日本亚洲一区二区 | 国产一区视频在线看| 91麻豆123| 26uuu成人网一区二区三区| 国产精品传媒在线| 日韩成人伦理电影在线观看| 成人精品国产一区二区4080| 欧美性欧美巨大黑白大战| 2021中文字幕一区亚洲| 亚洲激情av在线| 加勒比av一区二区| 在线欧美日韩国产| 国产亚洲欧洲997久久综合| 亚洲综合另类小说| 国产原创一区二区三区| 在线中文字幕一区二区| 久久精品亚洲麻豆av一区二区 | 天天综合日日夜夜精品| av电影在线观看一区| 日韩午夜电影在线观看| 亚洲激情在线激情| 91精品国产综合久久精品性色| 亚洲欧洲av色图| 狠狠v欧美v日韩v亚洲ⅴ| 欧美午夜精品一区二区三区| 国产人成亚洲第一网站在线播放 | 老司机精品视频一区二区三区| 色婷婷精品久久二区二区蜜臀av| 国产午夜精品久久久久久免费视| 日韩国产精品大片| 91福利国产精品| 亚洲欧美一区二区视频| 国产在线视频一区二区| 欧美福利电影网| 亚洲永久精品大片| 99久久国产免费看| 国产欧美一区二区三区在线看蜜臀| 青娱乐精品视频| 在线观看视频91| 亚洲欧美视频一区| av激情综合网| 国产精品国产三级国产普通话蜜臀 | 欧美色精品天天在线观看视频| 中文字幕亚洲视频| 大胆欧美人体老妇| 国产亚洲精久久久久久| 国产一区日韩二区欧美三区| 日韩一区二区视频| 日韩电影一二三区| 欧美日韩国产免费一区二区| 亚洲国产日韩a在线播放性色| aaa亚洲精品一二三区| 国产精品久久午夜| 成人黄色在线网站| 国产精品女主播av| 99久久综合精品| 亚洲同性gay激情无套| 91在线一区二区| 综合色中文字幕| 一本大道综合伊人精品热热| 亚洲精品国产一区二区三区四区在线 | 亚洲一区二区成人在线观看| 色婷婷亚洲一区二区三区| 亚洲伦理在线精品| 色视频一区二区| 亚洲国产精品久久久久秋霞影院 | 在线看日本不卡| 亚洲精品你懂的| 欧美中文字幕一区二区三区亚洲| 一区二区三区成人在线视频| 欧美性videosxxxxx| 性感美女极品91精品| 777久久久精品| 久久精品国产亚洲高清剧情介绍| 欧美不卡一区二区三区四区| 国内精品伊人久久久久av影院 | 亚洲国产精品久久久男人的天堂| 6080国产精品一区二区| 国产在线麻豆精品观看| 日本一区二区免费在线观看视频| av成人免费在线| 亚洲一卡二卡三卡四卡五卡| 91麻豆精品国产91久久久使用方法| 久久99久久久久| 中文字幕国产一区| 日本韩国欧美国产| 免费精品视频最新在线| 欧美精品一区二区三区在线 | 欧美国产乱子伦| 欧美综合色免费| 精品亚洲成av人在线观看| 国产欧美日产一区| 欧美日韩在线精品一区二区三区激情 | 专区另类欧美日韩| 欧美顶级少妇做爰| 国产毛片精品国产一区二区三区| 中文字幕一区二区视频| 欧美精品丝袜久久久中文字幕| 麻豆免费看一区二区三区| 国产精品免费视频一区| 欧美高清你懂得| 成人免费视频免费观看| 视频一区视频二区中文| 日本一区二区三区dvd视频在线| 欧美视频在线观看一区| 国产成人午夜精品影院观看视频 | 青青草97国产精品免费观看无弹窗版| 精品少妇一区二区三区日产乱码 | 中文字幕一区二区日韩精品绯色| 欧美日韩免费一区二区三区视频| 国产在线麻豆精品观看| 亚洲大片免费看| 国产精品美女视频| 日韩精品在线一区二区| 色88888久久久久久影院野外| 久久精品国产一区二区| 亚洲已满18点击进入久久| 精品成a人在线观看| 欧美在线小视频| www.66久久| 韩国欧美国产1区| 亚洲国产成人av| 中文字幕日韩一区| www成人在线观看| 欧美日韩精品久久久| 成人高清视频在线| 久久av中文字幕片| 天天综合天天综合色| 亚洲欧美另类久久久精品| 国产日韩v精品一区二区| 7878成人国产在线观看| 色八戒一区二区三区| proumb性欧美在线观看| 激情图片小说一区| 日本欧美肥老太交大片| 亚洲国产中文字幕在线视频综合 | 日本va欧美va欧美va精品| 亚洲欧美日韩国产中文在线| 欧美激情在线看| 亚洲精品一区二区三区福利 | 亚洲欧美经典视频| 中文字幕欧美区| 国产午夜精品福利| 久久久午夜电影| 久久综合九色欧美综合狠狠| 91精品国产综合久久久久久久| 欧美日韩视频在线第一区| 在线欧美一区二区| 欧美性高清videossexo| 在线看不卡av| 91豆麻精品91久久久久久|