001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.json;
016    
017    import java.io.Writer;
018    
019    /**
020     * @author Brian Wing Shun Chan
021     */
022    public interface JSONArray {
023    
024            public boolean getBoolean(int index);
025    
026            public double getDouble(int index);
027    
028            public int getInt(int index);
029    
030            public JSONArray getJSONArray(int index);
031    
032            public JSONObject getJSONObject(int index);
033    
034            public long getLong(int index);
035    
036            public String getString(int index);
037    
038            public boolean isNull(int index);
039    
040            public String join(String separator) throws JSONException;
041    
042            public int length();
043    
044            public JSONArray put(boolean value);
045    
046            public JSONArray put(double value);
047    
048            public JSONArray put(int value);
049    
050            public JSONArray put(JSONArray value);
051    
052            public JSONArray put(JSONObject value);
053    
054            public JSONArray put(long value);
055    
056            public JSONArray put(String value);
057    
058            @Override
059            public String toString();
060    
061            public String toString(int indentFactor) throws JSONException;
062    
063            public Writer write(Writer writer) throws JSONException;
064    
065    }