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