Cleanup some docs.

This commit is contained in:
MattBDev 2016-06-24 10:56:38 -04:00
parent 2c82d1106a
commit 6e25aab51f
10 changed files with 171 additions and 145 deletions

View File

@ -27,12 +27,12 @@ public interface ConfigurationSection {
/**
* Gets a Map containing all keys and their values for this section.
* <p>
* If deep is set to true, then this will contain all the keys and values
*
* <p>If deep is set to true, then this will contain all the keys and values
* within any child {@link ConfigurationSection}s (and their children,
* etc). These keys will be in a valid path notation for you to use.
* <p>
* If deep is set to false, then this will contain only the keys and
*
* <p>If deep is set to false, then this will contain only the keys and
* values of any direct children, and not their own children.
*
* @param deep Whether or not to get a deep list, as opposed to a shallow
@ -49,8 +49,8 @@ public interface ConfigurationSection {
*
* @param path Path to check for existence.
* @return True if this section contains the requested path, either via
* default or being set.
* @throws IllegalArgumentException Thrown when path is <code>null</code>.
* default or being set.
* @throws IllegalArgumentException Thrown when path is {@code null}.
*/
boolean contains(String path);
@ -64,7 +64,7 @@ public interface ConfigurationSection {
* @param path Path to check for existence.
* @return True if this section contains the requested path, regardless of
* having a default.
* @throws IllegalArgumentException Thrown when path is <code>null</code>.
* @throws IllegalArgumentException Thrown when path is {@code null}.
*/
boolean isSet(String path);
@ -77,7 +77,7 @@ public interface ConfigurationSection {
*
* <p>If the section is no longer contained within its root for any reason,
* such as being replaced with a different value,
* this may return <code>null</code>.
* this may return {@code null}.
*
* <p>To retrieve the single name of this section, that is, the final part
* of the path returned by this method, you may use {@link #getName()}.
@ -106,7 +106,7 @@ public interface ConfigurationSection {
*
* <p>If the section is no longer contained within its root for any reason,
* such as being replaced with a different value,
* this may return <code>null</code>.
* this may return {@code null}.
*
* @return Root configuration containing this section.
*/
@ -117,11 +117,11 @@ public interface ConfigurationSection {
* this {@link ConfigurationSection}.
*
* <p>For any {@link Configuration} themselves, this will return
* <code>null</code>.
* {@code null}.
*
* <p>If the section is no longer contained within its parent for any reason,
* such as being replaced with a different value, this may
* return <code>null</code>.
* <p>If the section is no longer contained within its parent for any
* reason, such as being replaced with a different value, this may
* return {@code null}.
*
* @return Parent section containing this section.
*/
@ -132,7 +132,7 @@ public interface ConfigurationSection {
*
* <p>If the Object does not exist but a default value has been specified,
* this will return the default value. If the Object does not exist and no
* default value was specified, this will return <code>null</code>.
* default value was specified, this will return {@code null}.
*
* @param path Path of the Object to get.
* @return Requested Object.
@ -156,7 +156,7 @@ public interface ConfigurationSection {
/**
* Sets the specified path to the given value.
*
* <p>If value is <code>null</code>, the entry will be removed. Any
* <p>If value is {@code null}, the entry will be removed. Any
* existing entry will be replaced, regardless of what the new value is.
*
* <p>Some implementations may have limitations on what you may store. See
@ -202,7 +202,7 @@ public interface ConfigurationSection {
*
* <p>If the String does not exist but a default value has been specified,
* this will return the default value. If the String does not exist and no
* default value was specified, this will return <code>null</code>.
* default value was specified, this will return {@code null}.
*
* @param path Path of the String to get.
* @return Requested String.
@ -470,13 +470,13 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Boolean by path.
* <p>
* If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p>
* This method will attempt to cast any values into a Boolean if possible,
* but may miss any values out if they are not compatible.
*
* <p>This method will attempt to cast any values into a Boolean if
* possible, but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
* @return Requested List of Boolean.
@ -485,12 +485,12 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Double by path.
* <p>
* If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p>
* This method will attempt to cast any values into a Double if possible,
*
* <p>This method will attempt to cast any values into a Double if possible,
* but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
@ -500,12 +500,12 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Float by path.
* <p>
* If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p>
* This method will attempt to cast any values into a Float if possible,
*
* <p>This method will attempt to cast any values into a Float if possible,
* but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
@ -515,12 +515,12 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Long by path.
* <p>
* If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p>
* This method will attempt to cast any values into a Long if possible,
*
* <p>This method will attempt to cast any values into a Long if possible,
* but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
@ -530,12 +530,12 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Byte by path.
* <p>
* If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p>
* This method will attempt to cast any values into a Byte if possible,
*
* <p>This method will attempt to cast any values into a Byte if possible,
* but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
@ -545,12 +545,12 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Character by path.
* <p>
* If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p>
* This method will attempt to cast any values into a Character if
*
* <p>This method will attempt to cast any values into a Character if
* possible, but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
@ -560,11 +560,13 @@ public interface ConfigurationSection {
/**
* Gets the requested List of Short by path.
* <p> If the List does not exist but a default value has been specified, this
* will return the default value. If the List does not exist and no
*
* <p>If the List does not exist but a default value has been specified,
* this will return the default value. If the List does not exist and no
* default value was specified, this will return an empty List.
* <p> This method will attempt to cast any values into a Short if possible,
* but may miss any values out if they are not compatible.
*
* <p>This method will attempt to cast any values into a Short if
* possible, but may miss any values out if they are not compatible.
*
* @param path Path of the List to get.
* @return Requested List of Short.
@ -591,7 +593,7 @@ public interface ConfigurationSection {
* <p>If the ConfigurationSection does not exist but a default value has
* been specified, this will return the default value. If the
* ConfigurationSection does not exist and no default value was specified,
* this will return <code>null</code>.
* this will return {@code null}.
*
* @param path Path of the ConfigurationSection to get.
* @return Requested ConfigurationSection.
@ -618,7 +620,7 @@ public interface ConfigurationSection {
*
* <p>If the root contains no defaults, or the defaults doesn't contain a
* value for this path, or the value at this path is not a {@link
* ConfigurationSection} then this will return <code>null</code>.
* ConfigurationSection} then this will return {@code null}.
*
* @return Equivalent section in root configuration
*/
@ -631,16 +633,16 @@ public interface ConfigurationSection {
* collection, then a new {@link MemoryConfiguration} will be created to
* hold the new default value.
*
* <p>If value is <code>null</code>, the value will be removed from the
* <p>If value is {@code null}, the value will be removed from the
* default Configuration source.
*
* <p>If the value as returned by {@link #getDefaultSection()} is
* <code>null</code>, then this will create a new section at the path,
* {@code null}, then this will create a new section at the path,
* replacing anything that may have existed there previously.
*
* @param path Path of the value to set
* @param value Value to set the default to
* @throws IllegalArgumentException Thrown if path is <code>null</code>
* @throws IllegalArgumentException Thrown if path is {@code null}
*/
void addDefault(String path, Object value);
}

View File

@ -74,7 +74,8 @@ public class MemorySection implements ConfigurationSection {
if (obj instanceof String) {
try {
return Double.parseDouble((String) obj);
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (obj instanceof List) {
List<?> val = (List<?>) obj;
if (!val.isEmpty()) {
@ -91,7 +92,8 @@ public class MemorySection implements ConfigurationSection {
if (obj instanceof String) {
try {
return Integer.parseInt((String) obj);
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (obj instanceof List) {
List<?> val = (List<?>) obj;
if (!val.isEmpty()) {
@ -108,7 +110,8 @@ public class MemorySection implements ConfigurationSection {
if (obj instanceof String) {
try {
return Long.parseLong((String) obj);
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (obj instanceof List) {
List<?> val = (List<?>) obj;
if (!val.isEmpty()) {
@ -565,7 +568,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) {
try {
result.add(Integer.valueOf((String) object));
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (object instanceof Character) {
result.add((int) (Character) object);
} else if (object instanceof Number) {
@ -609,7 +613,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) {
try {
result.add(Double.valueOf((String) object));
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (object instanceof Character) {
result.add((double) (Character) object);
} else if (object instanceof Number) {
@ -632,7 +637,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) {
try {
result.add(Float.valueOf((String) object));
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (object instanceof Character) {
result.add((float) (Character) object);
} else if (object instanceof Number) {
@ -655,7 +661,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) {
try {
result.add(Long.valueOf((String) object));
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (object instanceof Character) {
result.add((long) (Character) object);
} else if (object instanceof Number) {
@ -678,7 +685,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) {
try {
result.add(Byte.valueOf((String) object));
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (object instanceof Character) {
result.add((byte) ((Character) object).charValue());
} else if (object instanceof Number) {
@ -724,7 +732,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) {
try {
result.add(Short.valueOf((String) object));
} catch (NumberFormatException ignored) {}
} catch (NumberFormatException ignored) {
}
} else if (object instanceof Character) {
result.add((short) ((Character) object).charValue());
} else if (object instanceof Number) {
@ -833,7 +842,10 @@ public class MemorySection implements ConfigurationSection {
@Override
public String toString() {
Configuration root = getRoot();
return getClass().getSimpleName() + "[path='" + getCurrentPath() + "', root='" + (root == null ? null : root.getClass().getSimpleName()) +
"']";
if (root == null) {
return getClass().getSimpleName() + "[path='" + getCurrentPath() + "', root='" + null + "']";
} else {
return getClass().getSimpleName() + "[path='" + getCurrentPath() + "', root='" + root.getClass().getSimpleName() + "']";
}
}
}

View File

@ -42,8 +42,8 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
* automatically be applied, but you may include one if you wish for extra
* spacing.
*
* <p><code>null</code> is a valid value which will indicate that no header]
* is to be applied. The default value is <code>null</code>.
* <p>{@code null} is a valid value which will indicate that no header]
* is to be applied. The default value is {@code null}.
*
* @return Header
*/
@ -60,7 +60,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
* automatically be applied, but you may include one if you wish for extra
* spacing.
*
* <p><code>null</code> is a valid value which will indicate that no header
* <p>{@code null} is a valid value which will indicate that no header
* is to be applied.
*
* @param value New header

View File

@ -2,12 +2,12 @@ package com.intellectualcrafters.configuration.file;
/**
* Various settings for controlling the input and output of a {@link
* YamlConfiguration}
* YamlConfiguration}.
*/
public class YamlConfigurationOptions extends FileConfigurationOptions {
private int indent = 2;
YamlConfigurationOptions(final YamlConfiguration configuration) {
YamlConfigurationOptions(YamlConfiguration configuration) {
super(configuration);
}
@ -17,33 +17,33 @@ public class YamlConfigurationOptions extends FileConfigurationOptions {
}
@Override
public YamlConfigurationOptions copyDefaults(final boolean value) {
public YamlConfigurationOptions copyDefaults(boolean value) {
super.copyDefaults(value);
return this;
}
@Override
public YamlConfigurationOptions pathSeparator(final char value) {
public YamlConfigurationOptions pathSeparator(char value) {
super.pathSeparator(value);
return this;
}
@Override
public YamlConfigurationOptions header(final String value) {
public YamlConfigurationOptions header(String value) {
super.header(value);
return this;
}
@Override
public YamlConfigurationOptions copyHeader(final boolean value) {
public YamlConfigurationOptions copyHeader(boolean value) {
super.copyHeader(value);
return this;
}
/**
* Gets how much spaces should be used to indent each line.
* <p>
* The minimum value this may be is 2, and the maximum is 9.
*
* <p>The minimum value this may be is 2, and the maximum is 9.
*
* @return How much to indent by
*/
@ -53,13 +53,13 @@ public class YamlConfigurationOptions extends FileConfigurationOptions {
/**
* Sets how much spaces should be used to indent each line.
* <p>
* The minimum value this may be is 2, and the maximum is 9.
*
* <p>The minimum value this may be is 2, and the maximum is 9.
*
* @param value New indent
* @return This object, for chaining
*/
public YamlConfigurationOptions indent(final int value) {
public YamlConfigurationOptions indent(int value) {
if (value < 2) {
throw new IllegalArgumentException("Indent must be at least 2 characters");
}

View File

@ -11,7 +11,7 @@ import java.util.Map;
class YamlRepresenter extends Representer {
public YamlRepresenter() {
YamlRepresenter() {
this.multiRepresenters.put(ConfigurationSection.class, new RepresentConfigurationSection());
this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable());
}

View File

@ -4,9 +4,8 @@ import java.util.Map;
/**
* Represents an object that may be serialized.
* <p>
* These objects MUST implement one of the following, in addition to the
* methods as defined by this interface:
* <p>These objects MUST implement one of the following, in addition to
* the methods as defined by this interface:
* <ul>
* <li>A static method "deserialize" that accepts a single {@link Map}&lt;
* {@link String}, {@link Object}> and returns the class.</li>
@ -25,8 +24,8 @@ public interface ConfigurationSerializable {
/**
* Creates a Map representation of this class.
* <p>
* This class must provide a method to restore this class, as defined in
*
* <p>This class must provide a method to restore this class, as defined in
* the {@link ConfigurationSerializable} interface javadoc.
*
* @return Map containing the current state of this class

View File

@ -7,10 +7,11 @@ import java.io.OutputStream;
import java.util.List;
/**
* <p> This class writes <strong>NBT</strong>, or <strong>Named Binary Tag</strong> <code>Tag</code> objects to an
* underlying <code>OutputStream</code>. </p> <p> The NBT format was created by Markus Persson, and the
* specification may be found at
* @linktourl http://www.minecraft.net/docs/NBT.txt
* This class writes <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
* {@code Tag} objects to an underlying {@code OutputStream}.
*
* <p> The NBT format was created by Markus Persson, and the specification may
* be found at @linktourl http://www.minecraft.net/docs/NBT.txt
* </p>
*
* @author Graham Edgecombe
@ -23,7 +24,8 @@ public final class NBTOutputStream implements Closeable {
private final DataOutputStream os;
/**
* Creates a new <code>NBTOutputStream</code>, which will write data to the specified underlying output stream.
* Creates a new {@code NBTOutputStream}, which will write data to the
* specified underlying output stream.
*
* @param os The output stream.
*
@ -105,7 +107,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Byte</code> tag.
* Writes a {@code TAG_Byte} tag.
*
* @param tag The tag.
*
@ -116,7 +118,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Byte_Array</code> tag.
* Writes a {@code TAG_Byte_Array} tag.
*
* @param tag The tag.
*
@ -129,7 +131,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Compound</code> tag.
* Writes a {@code TAG_Compound} tag.
*
* @param tag The tag.
*
@ -143,7 +145,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_List</code> tag.
* Writes a {@code TAG_List} tag.
*
* @param tag The tag.
*
@ -161,7 +163,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_String</code> tag.
* Writes a {@code TAG_String} tag.
*
* @param tag The tag.
*
@ -174,7 +176,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Double</code> tag.
* Writes a {@code TAG_Double} tag.
*
* @param tag The tag.
*
@ -185,7 +187,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Float</code> tag.
* Writes a {@code TAG_Float} tag.
*
* @param tag The tag.
*
@ -196,7 +198,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Long</code> tag.
* Writes a {@code TAG_Long} tag.
*
* @param tag The tag.
*
@ -207,7 +209,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Int</code> tag.
* Writes a {@code TAG_Int} tag.
*
* @param tag The tag.
*
@ -218,7 +220,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Short</code> tag.
* Writes a {@code TAG_Short} tag.
*
* @param tag The tag.
*
@ -229,7 +231,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Writes a <code>TAG_Empty</code> tag.
* Writes a {@code TAG_Empty} tag.
*
* @param tag The tag.
*/
@ -251,7 +253,7 @@ public final class NBTOutputStream implements Closeable {
}
/**
* Flush output
* Flush output.
* @throws IOException
*/
public void flush() throws IOException {

View File

@ -107,9 +107,9 @@ public class Cookie {
}
/**
* Convert <code>%</code><i>hh</i> sequences to single characters, and convert plus to space.
* Convert {@code %}<i>hh</i> sequences to single characters, and convert plus to space.
*
* @param string A string that may contain <code>+</code> &nbsp;<small>(plus)</small> and <code>%</code><i>hh</i>
* @param string A string that may contain {@code +} &nbsp;<small>(plus)</small> and <code>%</code><i>hh</i>
* sequences.
*
* @return The unescaped string.

View File

@ -10,28 +10,28 @@ import java.util.Map;
/**
* A JSONArray is an ordered sequence of values. Its external text form is a string wrapped in square brackets with
* commas separating the values. The internal form is an object having <code>get</code> and <code>opt</code> methods for
* accessing the values by index, and <code>put</code> methods for adding or replacing values. The values can be any of
* these types: <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>, <code>Number</code>,
* <code>String</code>, or the <code>JSONObject.NULL object</code>.
* commas separating the values. The internal form is an object having {@code get} and {@code opt} methods for
* accessing the values by index, and {@code put} methods for adding or replacing values. The values can be any of
* these types: {@code Boolean}, {@code JSONArray}, {@code JSONObject}, {@code Number},
* {@code String}, or the {@code JSONObject.NULL object}.
*
* The constructor can convert a JSON text into a Java object. The <code>toString</code> method converts to JSON text.
* <p>The constructor can convert a JSON text into a Java object. The {@code toString} method converts to JSON text.
*
* A <code>get</code> method returns a value if one can be found, and throws an exception if one cannot be found. An
* <code>opt</code> method returns a default value instead of throwing an exception, and so is useful for obtaining
* <p>A {@code get} method returns a value if one can be found, and throws an exception if one cannot be found. An
* {@code opt} method returns a default value instead of throwing an exception, and so is useful for obtaining
* optional values.
*
* The generic <code>get()</code> and <code>opt()</code> methods return an object which you can cast or query for type.
* There are also typed <code>get</code> and <code>opt</code> methods that do type checking and type coercion for you.
* <p>The generic {@code get()} and {@code opt()} methods return an object which you can cast or query for type.
* There are also typed {@code get} and {@code opt} methods that do type checking and type coercion for you.
*
* The texts produced by the <code>toString</code> methods strictly conform to JSON syntax rules. 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 <code>null</code> 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
* <p>The texts produced by the {@code toString} methods strictly conform to JSON syntax rules. The constructors are
* more forgiving in the texts they will accept: <ul> <li>An extra {@code ,}&nbsp;<small>(comma)</small> may appear
* just before the closing bracket.</li> <li>The {@code null} value will be inserted when there is {@code ,}
* &nbsp;<small>(comma)</small> elision.</li> <li>Strings may be quoted with {@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> </ul>
* and if they do not contain leading or trailing spaces, and if they do not contain any of these characters: {@code { }
* [ ] / \ : , #} and if they do not look like numbers and if they are not the reserved words {@code true},
* {@code false}, or {@code null}.</li> </ul>
*
* @author JSON.org
* @version 2014-05-03
@ -90,8 +90,8 @@ public class JSONArray {
/**
* Construct a JSONArray from a source JSON text.
*
* @param source A string that begins with <code>[</code>&nbsp;<small>(left bracket)</small> and ends with
* <code>]</code> &nbsp;<small>(right bracket)</small>.
* @param source A string that begins with {@code [}&nbsp;<small>(left bracket)</small> and ends with
* {@code ]} &nbsp;<small>(right bracket)</small>.
*
* @throws JSONException If there is a syntax error.
*/
@ -283,7 +283,7 @@ public class JSONArray {
}
/**
* Make a string from the contents of this JSONArray. The <code>separator</code> string is inserted between each
* Make a string from the contents of this JSONArray. The {@code 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.
@ -449,10 +449,11 @@ public class JSONArray {
}
/**
* Get the optional long value associated with an index. The defaultValue is returned if there is no value for the
* index, or if the value is not a number and cannot be converted to a number.
* Get the optional long value associated with an index. The defaultValue
* is returned if there is no value for the index, or if the value is not a
* number and cannot be converted to a number.
*
* @param index The index must be between 0 and length() - 1.
* @param index The index must be between 0 and length() - 1.
* @param defaultValue The default value.
*
* @return The value.
@ -466,8 +467,9 @@ public class JSONArray {
}
/**
* Get the optional string value associated with an index. It returns an empty string if there is no value at that
* index. If the value is not a string and is not null, then it is converted to a string.
* Get the optional string value associated with an index. It returns an
* empty string if there is no value at that index. If the value is not a
* string and is not null, then it is converted to a string.
*
* @param index The index must be between 0 and length() - 1.
*
@ -478,7 +480,8 @@ public class JSONArray {
}
/**
* Get the optional string associated with an index. The defaultValue is returned if the key is not found.
* Get the optional string associated with an index. The defaultValue is
* returned if the key is not found.
*
* @param index The index must be between 0 and length() - 1.
* @param defaultValue The default value.
@ -503,7 +506,8 @@ public class JSONArray {
}
/**
* Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection.
* Put a value in the JSONArray, where the value will be a JSONArray which
* is produced from a Collection.
*
* @param value A Collection value.
*
@ -555,7 +559,8 @@ public class JSONArray {
}
/**
* Put a value in the JSONArray, where the value will be a JSONObject which is produced from a Map.
* Put a value in the JSONArray, where the value will be a JSONObject which
* is produced from a Map.
*
* @param value A Map value.
*
@ -569,8 +574,8 @@ public class JSONArray {
/**
* Append an object value. This increases the array's length by one.
*
* @param value An object value. The value should be a Boolean, Double, Integer, JSONArray, JSONObject, Long, or
* String, or the JSONObject.NULL object.
* @param value An object value. The value should be a Boolean, Double,
* Integer, JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
*
* @return this.
*/
@ -596,14 +601,16 @@ public class JSONArray {
}
/**
* Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection.
* Put a value in the JSONArray, where the value will be a JSONArray which
* is produced from a Collection.
*
* @param index The subscript.
* @param value A Collection value.
*
* @return this.
*
* @throws JSONException If the index is negative or if the value is not finite.
* @throws JSONException If the index is negative or if the value is not
* finite.
*/
public JSONArray put(int index, Collection<Object> value) throws JSONException {
this.put(index, new JSONArray(value));
@ -611,15 +618,17 @@ public class JSONArray {
}
/**
* Put or replace a double value. If the index is greater than the length of the JSONArray, then null elements will
* be added as necessary to pad it out.
* Put or replace a double value. If the index is greater than the length
* of the JSONArray, then null elements will be added as necessary to pad
* it out.
*
* @param index The subscript.
* @param value A double value.
*
* @return this.
*
* @throws JSONException If the index is negative or if the value is not finite.
* @throws JSONException If the index is negative or if the value is not
* finite.
*/
public JSONArray put(int index, double value) throws JSONException {
this.put(index, new Double(value));
@ -659,14 +668,16 @@ public class JSONArray {
}
/**
* Put a value in the JSONArray, where the value will be a JSONObject that is produced from a Map.
* Put a value in the JSONArray, where the value will be a JSONObject that
* is produced from a Map.
*
* @param index The subscript.
* @param value The Map value.
*
* @return this.
*
* @throws JSONException If the index is negative or if the the value is an invalid number.
* @throws JSONException If the index is negative or if the the value is an
* invalid number.
*/
public JSONArray put(int index, Map<String, Object> value) throws JSONException {
this.put(index, new JSONObject(value));
@ -790,7 +801,7 @@ public class JSONArray {
* @param indentFactor The number of spaces to add to each level of indentation.
*
* @return a printable, displayable, transmittable representation of the object, beginning with
* <code>[</code>&nbsp;<small>(left bracket)</small> and ending with <code>]</code> &nbsp;<small>(right
* {@code [}&nbsp;<small>(left bracket)</small> and ending with {@code ]} &nbsp;<small>(right
* bracket)</small>.
*
* @throws JSONException

View File

@ -25,6 +25,7 @@ import com.intellectualcrafters.plot.util.block.GlobalBlockQueue;
import com.intellectualcrafters.plot.util.block.LocalBlockQueue;
import com.intellectualcrafters.plot.util.expiry.PlotAnalysis;
import com.plotsquared.listener.PlotListener;
import java.awt.Rectangle;
import java.awt.geom.Area;
import java.awt.geom.PathIterator;
@ -738,8 +739,7 @@ public class Plot {
}
/**
* Clear a plot
* @see this#clear(Runnable)
* Clear a plot.
* @see this#clear(boolean, boolean, Runnable)
* @see #deletePlot(Runnable) to clear and delete a plot
* @param whenDone A runnable to execute when clearing finishes, or null