001    /**
002     * Copyright (c) 2000-present 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.Externalizable;
018    import java.io.Writer;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    @SuppressWarnings("rawtypes")
024    public interface JSONArray extends Externalizable, Iterable, JSONSerializable {
025    
026            public Object get(int index);
027    
028            public boolean getBoolean(int index);
029    
030            public double getDouble(int index);
031    
032            public int getInt(int index);
033    
034            public JSONArray getJSONArray(int index);
035    
036            public JSONObject getJSONObject(int index);
037    
038            public long getLong(int index);
039    
040            public String getString(int index);
041    
042            public boolean isNull(int index);
043    
044            public String join(String separator) throws JSONException;
045    
046            public int length();
047    
048            public JSONArray put(boolean value);
049    
050            public JSONArray put(double value);
051    
052            public JSONArray put(int value);
053    
054            public JSONArray put(JSONArray value);
055    
056            public JSONArray put(JSONObject value);
057    
058            public JSONArray put(long value);
059    
060            public JSONArray put(Object value);
061    
062            public JSONArray put(String value);
063    
064            @Override
065            public String toString();
066    
067            public String toString(int indentFactor) throws JSONException;
068    
069            public Writer write(Writer writer) throws JSONException;
070    
071    }