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

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

?? jsonarray.java

?? tiled地圖編輯器是2d的,很不錯的國外軟件,使用起來很方便的
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package org.json;

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 value null 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 contain leading
 *     or trailing spaces, and if they do not contain any of these characters:
 *     <code>{ } [ ] / \ : , ' "</code></li>
 * <li>Numbers may have the 0- (octal) or 0x- (hex) prefix.</li>
 * </ul>
 * <p>
 * Public Domain 2002 JSON.org
 * @author JSON.org
 * @version 0.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.
     * @param x A JSONTokener
     * @exception ParseException A JSONArray must start with '['
     * @exception ParseException Expected a ',' or ']'
     */
    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 ',':
                if (x.nextClean() == ']') {
                    return;
                }
                x.back();
                break;
            case ']':
                return;
            default:
                throw x.syntaxError("Expected a ',' or ']'");
            }
        }
    }


    /**
     * Construct a JSONArray from a source string.
     * @param string     A string that begins with 
     * <code>[</code>&nbsp;<small>(left bracket)</small>
     *  and ends with <code>]</code>&nbsp;<small>(right bracket)</small>.
     * @exception ParseException The string must conform to JSON syntax.
     */
    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.
     * @param index 
     *  The index must be between 0 and length() - 1.
     * @return An object value.
     * @exception NoSuchElementException
     */
    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.
     * @param index The index must be between 0 and length() - 1.
     * @return      The truth.
     * @exception NoSuchElementException if the index is not found
     * @exception ClassCastException
     */
    public boolean getBoolean(int index)
            throws ClassCastException, NoSuchElementException {
        Object o = get(index);
        if (o == Boolean.FALSE || o.equals("false")) {
            return false;
        } else if (o == Boolean.TRUE || o.equals("true")) {
            return true;
        }
        throw new ClassCastException("JSONArray[" + index +
            "] not a Boolean.");
    }


    /**
     * Get the double value associated with an index.     
     * @param index The index must be between 0 and length() - 1.
     * @return      The value.
     * @exception NoSuchElementException if the key is not found
     * @exception NumberFormatException
     *  if the value cannot be converted to a number.
     *
     */
    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.
     * 
     * @param index The index must be between 0 and length() - 1.
     * @return      The value.
     * @exception NoSuchElementException if the key is not found
     * @exception NumberFormatException
     *  if the value cannot be converted to a number.
     *
     */
    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.
     * @param index The index must be between 0 and length() - 1.
     * @return      A JSONArray value.
     * @exception NoSuchElementException if the index is not found or if the
     * value is not a JSONArray
     */
    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.
     * @param index subscript
     * @return      A JSONObject value.
     * @exception NoSuchElementException if the index is not found or if the
     * value is not a JSONObject
     */
    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.
     * @param index The index must be between 0 and length() - 1.
     * @return      A string value.
     * @exception NoSuchElementException
     */
    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".
     *
     * @param index The index must be between 0 and length() - 1.
     * @param defaultValue     A boolean default.
     * @return      The truth.
     */
    public boolean optBoolean(int index, boolean defaultValue)  {
        Object o = opt(index);
        if (o != null) {
            if (o == Boolean.FALSE || o.equals("false")) {
                return false;
            } else if (o == Boolean.TRUE || o.equals("true")) {
                return true;
            }
        }
        return defaultValue;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丰满少妇久久久久久久| 国产精品一卡二卡| 亚洲视频一二三| 国产精品久久久久影院老司| 久久美女高清视频| 国产色爱av资源综合区| 久久久精品免费网站| 国产三级一区二区三区| 日本一区二区三区电影| 国产精品对白交换视频| 中文字幕高清一区| 亚洲美女免费在线| 亚洲成人第一页| 蜜桃av噜噜一区| 国产精品99久久久久久宅男| av一二三不卡影片| 在线精品视频小说1| 91精品国产一区二区| 精品不卡在线视频| 中文字幕一区在线观看视频| 亚洲欧美日韩在线播放| 日本三级亚洲精品| 国产精品18久久久久久久久| 成人一区二区三区在线观看| 91丨porny丨中文| 91精选在线观看| 国产日韩综合av| 一区二区三区 在线观看视频| 日韩国产一区二| 国产成人精品免费一区二区| 日本精品免费观看高清观看| 日韩女优制服丝袜电影| 亚洲欧洲成人精品av97| 蜜臀va亚洲va欧美va天堂 | 亚洲夂夂婷婷色拍ww47| 美美哒免费高清在线观看视频一区二区| 久久99蜜桃精品| 欧洲一区二区av| 久久女同互慰一区二区三区| 一区二区久久久久| 国产麻豆精品在线观看| 欧美性猛片aaaaaaa做受| 久久精品视频一区二区| 亚洲综合999| 播五月开心婷婷综合| 日韩欧美一区电影| 亚洲免费观看高清| 国产999精品久久久久久| 在线综合+亚洲+欧美中文字幕| 国产婷婷一区二区| 麻豆精品蜜桃视频网站| 欧美日韩一区二区欧美激情| 中文字幕一区二区三区在线观看| 偷偷要91色婷婷| 在线观看一区日韩| 成人欧美一区二区三区| 国产成人小视频| 精品国产百合女同互慰| 天天色天天爱天天射综合| 色综合天天综合| 亚洲国产精品精华液ab| 国产一本一道久久香蕉| 欧美一区二区三区思思人| 午夜激情一区二区| 欧美在线啊v一区| 夜夜精品浪潮av一区二区三区| 成人h精品动漫一区二区三区| 久久久国产精品麻豆| 精品一区二区日韩| 日韩精品一区二区三区蜜臀| 丝袜脚交一区二区| 欧美日韩在线播| 一区二区三区不卡在线观看| 在线一区二区三区四区五区 | 男人操女人的视频在线观看欧美| 欧美日韩中文字幕精品| 亚洲一区在线播放| 91精品福利视频| 一区二区三区资源| 在线观看日韩毛片| 石原莉奈在线亚洲二区| 欧美福利视频一区| 免费不卡在线视频| 精品国产91久久久久久久妲己| 蜜乳av一区二区| 久久这里只精品最新地址| 国产999精品久久久久久| 国产精品久久久久天堂| 在线视频你懂得一区| 午夜精品福利一区二区三区蜜桃| 欧美日韩国产一区二区三区地区| 日韩精品欧美精品| 2021国产精品久久精品| 成人免费视频国产在线观看| 一区二区三区在线视频观看58| 欧美亚洲另类激情小说| 日本不卡在线视频| 国产精品丝袜黑色高跟| 91高清视频在线| 激情综合色播激情啊| 最新中文字幕一区二区三区| 欧美日韩视频在线一区二区| 国产真实乱偷精品视频免| 一区在线观看免费| 欧美日韩三级视频| 国产成人免费9x9x人网站视频| 一区二区三区电影在线播| 日韩美女视频在线| 91日韩精品一区| 国内外成人在线视频| 亚洲人精品午夜| 精品少妇一区二区三区在线视频| 99热这里都是精品| 精品一区二区三区视频在线观看 | 26uuu亚洲| 91福利国产成人精品照片| 九色综合狠狠综合久久| 亚洲精品一二三四区| 欧美mv日韩mv国产网站app| 色综合久久中文综合久久牛| 九九视频精品免费| 一区二区三区四区精品在线视频 | 日本中文字幕一区二区视频 | 日韩一区二区三区免费看| 成人黄色综合网站| 日本不卡在线视频| 亚洲一区二区三区视频在线播放| 国产网站一区二区三区| 欧美一区二区网站| 在线观看视频91| 99riav久久精品riav| 国产91清纯白嫩初高中在线观看| 日韩国产欧美一区二区三区| 一区二区在线免费观看| 国产日韩一级二级三级| 精品国产一区久久| 4438x成人网最大色成网站| 色爱区综合激月婷婷| 9l国产精品久久久久麻豆| 国产老肥熟一区二区三区| 免费av成人在线| 日本大胆欧美人术艺术动态| 亚洲地区一二三色| 午夜精品久久久久久久| 一区二区三国产精华液| 夜夜嗨av一区二区三区中文字幕| 国产精品免费视频观看| 国产欧美精品在线观看| 久久奇米777| 国产色产综合产在线视频| 久久蜜桃一区二区| 国产亚洲精品福利| 国产精品素人视频| 日本一二三不卡| **欧美大码日韩| 亚洲自拍欧美精品| 丝袜美腿成人在线| 蜜桃av一区二区三区电影| 精品写真视频在线观看| 激情国产一区二区| 国产经典欧美精品| 成人性生交大片免费看视频在线| 成人理论电影网| 91色在线porny| 欧美肥妇bbw| 337p粉嫩大胆色噜噜噜噜亚洲| 国产日本欧美一区二区| 国产精品天干天干在线综合| 亚洲人成亚洲人成在线观看图片| 亚洲一区影音先锋| 男女男精品视频| 激情图片小说一区| 91偷拍与自偷拍精品| 精品视频在线看| 欧美精品一区男女天堂| 综合色天天鬼久久鬼色| 一区二区三区在线免费播放 | 国产一区二区视频在线| 成人国产精品免费观看动漫| 91丝袜美腿高跟国产极品老师| 欧美日韩一区在线观看| 久久天天做天天爱综合色| 亚洲日本中文字幕区| 青青草97国产精品免费观看无弹窗版 | 国产精品久久久久久久蜜臀| 亚洲亚洲人成综合网络| 国产在线播放一区| 99热精品国产| 精品捆绑美女sm三区| 亚洲男女一区二区三区| 久久99精品视频| 91福利视频在线| 久久九九全国免费| 日韩国产精品久久| 99久久久精品| 欧美xxxx老人做受| 亚洲成年人网站在线观看| 国产成人精品影院| 日韩一区二区免费高清| 亚洲免费看黄网站|