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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jsonarray.java

?? Foundations_Of_Ajax中文版的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
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.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国一区二区三区视频| 一区二区三区美女视频| 国产色产综合产在线视频| eeuss国产一区二区三区| 日本视频免费一区| 国产91富婆露脸刺激对白| 久久精品噜噜噜成人av农村| 天堂久久一区二区三区| 日本欧美一区二区| 国产精品一二三四区| 一本大道综合伊人精品热热| 91.com视频| 国产欧美日韩三级| 亚洲国产va精品久久久不卡综合| 午夜精品久久久久影视| 国产精品自拍av| 欧美日韩一区在线| 欧美国产国产综合| 亚洲高清久久久| 高清beeg欧美| 精品日韩一区二区三区免费视频| 亚洲国产激情av| 蜜臀精品久久久久久蜜臀 | 色88888久久久久久影院按摩 | 高清在线不卡av| 欧美久久免费观看| 自拍偷自拍亚洲精品播放| 蜜臀av一区二区在线观看| 成人免费看的视频| 91福利国产精品| 中文字幕乱码久久午夜不卡| 日韩极品在线观看| 欧美在线观看18| 亚洲欧美日韩久久精品| 国产不卡在线播放| www激情久久| 日本伊人色综合网| 3d动漫精品啪啪1区2区免费| 亚洲精品大片www| 色偷偷久久人人79超碰人人澡| xnxx国产精品| 国内精品免费**视频| 欧美一区二区三区男人的天堂| 亚洲国产精品影院| 欧美精品三级日韩久久| 偷拍自拍另类欧美| 欧美高清视频不卡网| 午夜久久久久久久久| 欧美男同性恋视频网站| 日日嗨av一区二区三区四区| 欧美日韩不卡一区二区| 日本人妖一区二区| 26uuu欧美日本| av毛片久久久久**hd| 亚洲精品免费在线| 欧美一区永久视频免费观看| 麻豆精品在线看| 国产片一区二区| 国产亚洲一区二区三区四区| 欧美性一级生活| 91美女精品福利| 一二三四社区欧美黄| 91精品国产欧美日韩| 97se亚洲国产综合在线| 国产在线精品一区二区夜色 | 欧美一区二区三区精品| 国产在线视频精品一区| 亚洲精品日日夜夜| 日韩午夜激情免费电影| 成人性生交大片免费看中文| 欧美色国产精品| 国产亚洲成av人在线观看导航 | 一区二区三区四区视频精品免费 | 综合电影一区二区三区 | 日本不卡视频在线观看| 国产日韩影视精品| 在线观看91精品国产入口| 国产一区二区免费看| 亚洲一区二区综合| 亚洲欧洲成人av每日更新| ww久久中文字幕| 日韩免费福利电影在线观看| 一本色道a无线码一区v| 成人午夜激情片| 精品sm捆绑视频| 欧美一区二区三区免费视频| 欧美色爱综合网| 欧美色区777第一页| 91麻豆精品国产自产在线 | 久久久久久久综合狠狠综合| 国产午夜精品一区二区三区视频 | 国产黄色精品视频| 91在线看国产| 91久久精品网| 欧美亚洲国产一区在线观看网站| 色婷婷精品久久二区二区蜜臀av | 色老汉一区二区三区| 激情国产一区二区| 久久精品视频免费观看| 91麻豆精品91久久久久同性| 久久你懂得1024| 日韩欧美一区电影| 国产亚洲女人久久久久毛片| 亚洲欧美一区二区在线观看| 午夜免费久久看| 成人综合婷婷国产精品久久蜜臀 | 亚洲视频资源在线| 一区av在线播放| 亚洲一区在线视频| 免费精品视频在线| 亚洲国产精品久久久久婷婷884 | 激情久久五月天| 视频一区在线视频| 亚洲国产精品久久一线不卡| 亚洲色图清纯唯美| 国产精品国产三级国产普通话蜜臀| 国产亚洲精品aa午夜观看| 亚洲天堂a在线| 亚洲综合色成人| 午夜免费欧美电影| 免费在线成人网| 精品一二三四在线| 国产精品亚洲人在线观看| 国产成人自拍网| 丰满少妇久久久久久久| www.久久久久久久久| 在线国产电影不卡| 欧美精品日韩精品| 久久九九久久九九| 中文字幕亚洲电影| 97se亚洲国产综合自在线| 9l国产精品久久久久麻豆| 国产亚洲短视频| 激情都市一区二区| 亚洲国产精品成人综合色在线婷婷| 一二三四区精品视频| 日韩av一二三| 久久国产福利国产秒拍| 精品一区二区久久久| 91丨porny丨中文| 亚洲精品国产精品乱码不99| 欧美成人综合网站| 夜夜操天天操亚洲| av不卡免费电影| 亚洲色大成网站www久久九九| 678五月天丁香亚洲综合网| www.欧美色图| 国内国产精品久久| 丝袜美腿亚洲色图| 亚洲激情一二三区| 国产精品久久三区| 欧美精品一区男女天堂| 欧美日韩成人高清| 中文字幕亚洲综合久久菠萝蜜| 日韩成人一区二区三区在线观看| 不卡一区二区中文字幕| 精品福利av导航| 日韩精品乱码免费| 欧美亚洲丝袜传媒另类| 国产精品午夜春色av| 免费观看在线综合| 3d动漫精品啪啪1区2区免费| 国产精品久久久久毛片软件| 天堂久久久久va久久久久| 91一区二区三区在线观看| 久久精品一区八戒影视| 国产又粗又猛又爽又黄91精品| 欧美日韩激情在线| 午夜一区二区三区视频| 色视频成人在线观看免| 亚洲色图视频网| 欧美亚洲高清一区| 亚洲精品精品亚洲| 91久久精品一区二区三区| 国产精品成人在线观看| 99精品久久免费看蜜臀剧情介绍| 国产日韩精品一区二区浪潮av| 国产另类ts人妖一区二区| 精品三级在线观看| 国产一区啦啦啦在线观看| 精品久久久久久综合日本欧美| 美女一区二区视频| 欧美精品一区二区高清在线观看| 日本欧美肥老太交大片| 91精品久久久久久久99蜜桃| 久久在线免费观看| 国产乱人伦偷精品视频免下载| 日韩综合一区二区| 综合色中文字幕| 欧美日韩一区二区三区在线| 成人免费高清在线| 亚洲色图.com| 在线电影一区二区三区| 免费成人你懂的| 国产精品超碰97尤物18| 欧美激情综合五月色丁香小说| 国产精品久久久久影院亚瑟| 香蕉久久夜色精品国产使用方法 | 国产免费观看久久| 国产女人aaa级久久久级|