Interface MutableTomlArray
- All Superinterfaces:
TomlArray
TomlArray whose values can be edited in place.
Accepts the values MutableTomlTable accepts, converted the same way. A TomlTable or TomlArray
stored as a value is stored as a deep copy, so later changes to the original are not seen; the stored copy is edited
through the getters that return it. null throws a NullPointerException.
A key or a String value must not contain an unpaired surrogate, an OffsetDateTime's offset
must be a whole number of minutes, and a LocalDate, LocalDateTime or
OffsetDateTime must have a year between 0 and 9999, since none of these can be written as TOML.
An entry's attached comments are edited through its MutableTomlEntry obtained from entry(int), or through
the shortcuts here. An unattached comment is added after the last element with addComment(java.lang.String...) and removed with
removeComment(int, org.tomlj.TomlComment.Placement). An entry or a comment can be inserted before or after the entry at an index, or before or
after any element of this array's sequence, as TomlArray.elements() returns it, with insertBefore(int, java.lang.Object),
insertAfter(int, java.lang.Object), insertCommentBefore(int, java.lang.String...), or insertCommentAfter(int, java.lang.String...).
An array read from [[x]] headers accepts any value; nothing requires its entries to stay tables.
An array is written back out with TomlArray.toToml(), and reformat(TomlWriteOptions.Keep) makes it, and
everything nested in it, keep less of its existing structure and format.
Not safe for use from multiple threads without external synchronization.
-
Method Summary
Modifier and TypeMethodDescriptionAppend a value to this array.default MutableTomlArrayaddComment(String... lines) Add an unattached comment, after the elements already written, asaddComment(List)does.default MutableTomlArrayaddComment(List<String> lines) Add an unattached comment, after the elements already written.addComment(TomlComment comment) Add a comment, after the elements already written.voidclear()Remove every entry from this array.static MutableTomlArrayCreate an array from anIterable.static MutableTomlArrayCreate a deep copy of an array.static MutableTomlArraycreate()Create a new, empty array.static MutableTomlArrayCreate a new, empty array to be written between brackets.entry(int index) Get the entry at an index.default MutableTomlArraygetArray(int index) Get an array at a specified index.default MutableTomlTablegetTable(int index) Get a table at a specified index.insertAfter(int index, Object value) Insert a value into this array immediately after the entry at an index.insertAfter(TomlElement anchor, Object value) Insert a value into this array immediately after an element of its sequence.insertBefore(int index, Object value) Insert a value into this array immediately before the entry at an index.insertBefore(TomlElement anchor, Object value) Insert a value into this array immediately before an element of its sequence.default MutableTomlArrayinsertCommentAfter(int index, String... lines) Insert an unattached comment into this array immediately after the entry at an index, asinsertCommentAfter(int, List)does.default MutableTomlArrayinsertCommentAfter(int index, List<String> lines) Insert an unattached comment into this array immediately after the entry at an index, asinsertCommentAfter(int, TomlComment)places one.insertCommentAfter(int index, TomlComment comment) Insert a comment into this array immediately after the entry at an index.default MutableTomlArrayinsertCommentAfter(TomlElement anchor, String... lines) Insert an unattached comment into this array immediately after an element of its sequence, asinsertCommentAfter(TomlElement, List)does.default MutableTomlArrayinsertCommentAfter(TomlElement anchor, List<String> lines) Insert an unattached comment into this array immediately after an element of its sequence, asinsertCommentAfter(TomlElement, TomlComment)places one.insertCommentAfter(TomlElement anchor, TomlComment comment) Insert a comment into this array immediately after an element of its sequence.default MutableTomlArrayinsertCommentBefore(int index, String... lines) Insert an unattached comment into this array immediately before the entry at an index, asinsertCommentBefore(int, List)does.default MutableTomlArrayinsertCommentBefore(int index, List<String> lines) Insert an unattached comment into this array immediately before the entry at an index, asinsertCommentBefore(int, TomlComment)places one.insertCommentBefore(int index, TomlComment comment) Insert a comment into this array immediately before the entry at an index.default MutableTomlArrayinsertCommentBefore(TomlElement anchor, String... lines) Insert an unattached comment into this array immediately before an element of its sequence, asinsertCommentBefore(TomlElement, List)does.default MutableTomlArrayinsertCommentBefore(TomlElement anchor, List<String> lines) Insert an unattached comment into this array immediately before an element of its sequence, asinsertCommentBefore(TomlElement, TomlComment)places one.insertCommentBefore(TomlElement anchor, TomlComment comment) Insert a comment into this array immediately before an element of its sequence.booleanWhether this array was changed through this interface.booleanisModified(int index) Whether an entry of this array was changed through this interface.static MutableTomlArrayCreate an array from a sequence of values.Keep less of the existing structure and format of this array, and of everything in it.remove(int index) Remove the value at an index.default MutableTomlArrayremoveComment(int index, TomlComment.Placement placement) Remove the attached comment at a placement, asMutableTomlEntry.removeComment(TomlComment.Placement)does.booleanremoveComment(TomlComment comment) Remove an unattached comment, by identity.default MutableTomlArrayremoveCommentAbove(int index) Remove the run of comment lines written above an entry, asMutableTomlEntry.removeCommentAbove()does.default MutableTomlArrayremoveCommentAfter(int index) Remove the comment written on an entry's line, asMutableTomlEntry.removeCommentAfter()does.Replace the value at an index.default MutableTomlArraysetComment(int index, String text, TomlComment.Placement placement) Set an attached comment on an entry from its text, asMutableTomlEntry.setComment(String, TomlComment.Placement)does.default MutableTomlArraysetComment(int index, TomlComment comment) Set an attached comment on an entry, asMutableTomlEntry.setComment(TomlComment)does.default MutableTomlArraysetCommentAbove(int index, String... lines) Set the run of comment lines written above an entry, asMutableTomlEntry.setCommentAbove(String...)does.default MutableTomlArraysetCommentAbove(int index, List<String> lines) Set the run of comment lines written above an entry, asMutableTomlEntry.setCommentAbove(List)does.default MutableTomlArraysetCommentAfter(int index, String text) Set the comment written on an entry's line, asMutableTomlEntry.setCommentAfter(String)does.Methods inherited from interface org.tomlj.TomlArray
comment, comments, elements, get, getBoolean, getDouble, getLocalDate, getLocalDateTime, getLocalTime, getLong, getOffsetDateTime, getString, inputPositionOf, isArray, isBoolean, isDouble, isEmpty, isLocalDate, isLocalDateTime, isLocalTime, isLong, isOffsetDateTime, isString, isTable, size, toJson, toJson, toJson, toJson, toList, toToml, toToml, toToml, toToml
-
Method Details
-
create
Create a new, empty array.- Returns:
- A new, empty array.
-
createInline
Create a new, empty array to be written between brackets.The array is written between brackets on the line of the entry holding it, as
a = [{ x = 1 }], whatever it holds, unless the document is written keeping nothing (TomlWriteOptions.Keep.NOTHING). An array made withcreate()whose elements are all tables is written as[[a]]headers instead.- Returns:
- A new, empty array.
-
of
Create an array from a sequence of values.- Parameters:
values- The values, each converted asadd(Object)converts one.- Returns:
- A new array with one entry per value.
- Throws:
NullPointerException- If a value isnull.IllegalArgumentException- If a value cannot be converted to a TOML value, or cannot be written as TOML.
-
add
Append a value to this array.The new entry has no position and no comments. A table or array is stored as a deep copy, made as
copyOf(TomlArray)makes one, so it has no positions.- Parameters:
value- The value to add.- Returns:
- This array.
- Throws:
NullPointerException- Ifvalueisnull.IllegalArgumentException- Ifvaluecannot be converted to a TOML value, or cannot be written as TOML.
-
insertBefore
Insert a value into this array immediately before the entry at an index.The new entry goes immediately before the entry at
indexin this array'sTomlArray.elements(), so an unattached comment beside that entry stays on its own side. The new entry has no position and no comments, andvalueis converted asadd(Object)converts one. A table or array is stored as a deep copy, made ascopyOf(TomlArray)makes one, so it has no positions.- Parameters:
index- The array index of the entry to insert before.value- The value to insert.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- Ifvalueisnull.IllegalArgumentException- Ifvaluecannot be converted to a TOML value, or cannot be written as TOML.
-
insertAfter
Insert a value into this array immediately after the entry at an index.The new entry goes immediately after the entry at
indexin this array'sTomlArray.elements(), so an unattached comment beside that entry stays on its own side.insertAfter(size() - 1, value)differs fromadd(Object): it places the new entry immediately after the last entry, before any unattached comments that follow it, whileaddappends after the last element. The new entry has no position and no comments, andvalueis converted asadd(Object)converts one. A table or array is stored as a deep copy, made ascopyOf(TomlArray)makes one, so it has no positions.- Parameters:
index- The array index of the entry to insert after.value- The value to insert.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- Ifvalueisnull.IllegalArgumentException- Ifvaluecannot be converted to a TOML value, or cannot be written as TOML.
-
insertBefore
Insert a value into this array immediately before an element of its sequence.The anchor is an element of this array's own
TomlArray.elements(), matched by identity: an element of a sub-array, a copy, or another document is rejected, even if it is equal. It may be an entry or an unattached comment; "before an entry" means before the entry itself, so a comment attached above it stays attached to it. The new entry has no position and no comments, andvalueis converted asadd(Object)converts one. A table or array is stored as a deep copy, made ascopyOf(TomlArray)makes one, so it has no positions.- Parameters:
anchor- The element to insert before.value- The value to insert.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchororvalueisnull.IllegalArgumentException- Ifvaluecannot be converted to a TOML value, or cannot be written as TOML.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
insertAfter
Insert a value into this array immediately after an element of its sequence.The new entry is placed immediately after
anchor, matched asinsertBefore(TomlElement, Object)matches one. The new entry has no position and no comments, andvalueis converted asadd(Object)converts one. A table or array is stored as a deep copy, made ascopyOf(TomlArray)makes one, so it has no positions.- Parameters:
anchor- The element to insert after.value- The value to insert.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchororvalueisnull.IllegalArgumentException- Ifvaluecannot be converted to a TOML value, or cannot be written as TOML.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
set
Replace the value at an index.The entry keeps its place in the array and its attached comments. Its position is its value's, and a value set here has none, so
TomlArray.inputPositionOf(int)isnullfor the index afterwards. A table or array is stored as a deep copy, made ascopyOf(TomlArray)makes one.- Parameters:
index- The array index.value- The replacement value.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- Ifvalueisnull.IllegalArgumentException- Ifvaluecannot be converted to a TOML value, or cannot be written as TOML.
-
remove
Remove the value at an index.The entry is removed, with the comments attached to it, and every later entry moves down by one. The unattached comments among this array's elements stay where they are.
- Parameters:
index- The array index.- Returns:
- The value that was removed.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.
-
clear
void clear()Remove every entry from this array.The unattached comments among this array's elements stay where they are. Clearing an array that is already empty is not a modification.
-
isModified
boolean isModified()Whether this array was changed through this interface.A change is an entry added, replaced or removed, in this array or in any table or array nested within it. An array read from a document, or newly created, reports
false; nothing resets this once it istrue.- Returns:
trueif this array was changed through this interface.
-
isModified
boolean isModified(int index) Whether an entry of this array was changed through this interface.A change is the entry added or replaced, or a change within the table or array it holds.
- Parameters:
index- The array index.- Returns:
trueif the entry was changed.- Throws:
IndexOutOfBoundsException- If the index is out of bounds.
-
setCommentAbove
Set the run of comment lines written above an entry, asMutableTomlEntry.setCommentAbove(String...)does.- Parameters:
index- The array index.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- If a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
setCommentAbove
Set the run of comment lines written above an entry, asMutableTomlEntry.setCommentAbove(List)does.- Parameters:
index- The array index.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- Iflines, or a line, isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
setCommentAfter
Set the comment written on an entry's line, asMutableTomlEntry.setCommentAfter(String)does.- Parameters:
index- The array index.text- The comment text, asTomlComment.lines()would return its one line.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- Iftextisnull.IllegalArgumentException- Iftextcannot be written as a TOML comment.
-
setComment
Set an attached comment on an entry from its text, asMutableTomlEntry.setComment(String, TomlComment.Placement)does.- Parameters:
index- The array index.text- The comment's text, asTomlComment.text()would return it.placement- Where the comment sits relative to the entry,TomlComment.Placement.ABOVEorTomlComment.Placement.AFTER.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- Iftextorplacementisnull.IllegalArgumentException- IfplacementisTomlComment.Placement.UNATTACHED, or a line oftextcannot be written as a TOML comment.
-
setComment
Set an attached comment on an entry, asMutableTomlEntry.setComment(TomlComment)does.- Parameters:
index- The array index.comment- The comment, withTomlComment.placement()eitherTomlComment.Placement.ABOVEorTomlComment.Placement.AFTER.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- Ifcommentisnull.IllegalArgumentException- Ifcommentis unattached.
-
removeCommentAbove
Remove the run of comment lines written above an entry, asMutableTomlEntry.removeCommentAbove()does.- Parameters:
index- The array index.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.
-
removeCommentAfter
Remove the comment written on an entry's line, asMutableTomlEntry.removeCommentAfter()does.- Parameters:
index- The array index.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.
-
removeComment
Remove the attached comment at a placement, asMutableTomlEntry.removeComment(TomlComment.Placement)does.- Parameters:
index- The array index.placement- Which attached comment to remove,TomlComment.Placement.ABOVEorTomlComment.Placement.AFTER.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.NullPointerException- Ifplacementisnull.IllegalArgumentException- IfplacementisTomlComment.Placement.UNATTACHED.
-
addComment
Add an unattached comment, after the elements already written, asaddComment(List)does.- Parameters:
lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
NullPointerException- If a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
addComment
Add an unattached comment, after the elements already written.- Parameters:
lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
NullPointerException- Iflines, or a line, isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
addComment
Add a comment, after the elements already written.The comment's position is ignored: the copy stored here has none. This is how an unattached comment is copied from one table or array to another, across documents too.
- Parameters:
comment- The comment to add, with no placement.- Returns:
- This array.
- Throws:
NullPointerException- Ifcommentisnull.IllegalArgumentException- Ifcommentis attached.
-
insertCommentBefore
Insert an unattached comment into this array immediately before the entry at an index, asinsertCommentBefore(int, List)does.- Parameters:
index- The array index of the entry to insert before.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- If a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
insertCommentBefore
Insert an unattached comment into this array immediately before the entry at an index, asinsertCommentBefore(int, TomlComment)places one.- Parameters:
index- The array index of the entry to insert before.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- Iflines, or a line, isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
insertCommentBefore
Insert a comment into this array immediately before the entry at an index.The comment is inserted as
addComment(TomlComment)adds one, its position ignored, immediately before the entry atindex, asinsertBefore(int, Object)places a value.- Parameters:
index- The array index of the entry to insert before.comment- The comment to insert, with no placement.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- Ifcommentisnull.IllegalArgumentException- Ifcommentis attached.
-
insertCommentAfter
Insert an unattached comment into this array immediately after the entry at an index, asinsertCommentAfter(int, List)does.- Parameters:
index- The array index of the entry to insert after.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- If a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
insertCommentAfter
Insert an unattached comment into this array immediately after the entry at an index, asinsertCommentAfter(int, TomlComment)places one.- Parameters:
index- The array index of the entry to insert after.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- Iflines, or a line, isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.
-
insertCommentAfter
Insert a comment into this array immediately after the entry at an index.The comment is inserted as
addComment(TomlComment)adds one, its position ignored, immediately after the entry atindex, asinsertAfter(int, Object)places a value.- Parameters:
index- The array index of the entry to insert after.comment- The comment to insert, with no placement.- Returns:
- This array.
- Throws:
IndexOutOfBoundsException- Ifindexis negative or not less thanTomlArray.size().NullPointerException- Ifcommentisnull.IllegalArgumentException- Ifcommentis attached.
-
insertCommentBefore
Insert an unattached comment into this array immediately before an element of its sequence, asinsertCommentBefore(TomlElement, List)does.- Parameters:
anchor- The element to insert before.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchor,lines, or a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
insertCommentBefore
Insert an unattached comment into this array immediately before an element of its sequence, asinsertCommentBefore(TomlElement, TomlComment)places one.- Parameters:
anchor- The element to insert before.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchor,lines, or a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
insertCommentBefore
Insert a comment into this array immediately before an element of its sequence.The comment is inserted as
addComment(TomlComment)adds one, its position ignored. The anchor is an element of this array's ownTomlArray.elements(), matched by identity: an element of a sub-array, a copy, or another document is rejected, even if it is equal. It may be an entry or an unattached comment; "before an entry" means before the entry itself, so its own attached comments stay attached to it.- Parameters:
anchor- The element to insert before.comment- The comment to insert, with no placement.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchororcommentisnull.IllegalArgumentException- Ifcommentis attached.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
insertCommentAfter
Insert an unattached comment into this array immediately after an element of its sequence, asinsertCommentAfter(TomlElement, List)does.- Parameters:
anchor- The element to insert after.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchor,lines, or a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
insertCommentAfter
Insert an unattached comment into this array immediately after an element of its sequence, asinsertCommentAfter(TomlElement, TomlComment)places one.- Parameters:
anchor- The element to insert after.lines- The text of each line, asTomlComment.lines()would return it; a line holding a newline is split there.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchor,lines, or a line isnull.IllegalArgumentException- Iflinesis empty, or a line cannot be written as a TOML comment.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
insertCommentAfter
Insert a comment into this array immediately after an element of its sequence.The comment is inserted as
addComment(TomlComment)adds one, its position ignored, immediately afteranchor, matched asinsertCommentBefore(TomlElement, TomlComment)matches one.- Parameters:
anchor- The element to insert after.comment- The comment to insert, with no placement.- Returns:
- This array.
- Throws:
NullPointerException- Ifanchororcommentisnull.IllegalArgumentException- Ifcommentis attached.NoSuchElementException- Ifanchoris not an element of this array'sTomlArray.elements().
-
removeComment
Remove an unattached comment, by identity.- Parameters:
comment- The comment to remove.- Returns:
trueifcommentwas among this array'sTomlArray.elements(), and was removed. An attached comment is never among them, so removing one here always returnsfalse.
-
reformat
Keep less of the existing structure and format of this array, and of everything in it.A parse result is written from the text it was parsed from, so an array keeps its layout until it is changed. Reformatting it discards that:
- With
TomlWriteOptions.Keep.LAYOUT, which every array starts with, nothing changes. - With
TomlWriteOptions.Keep.NOTATIONits elements keep their order, comments, literal forms and the structure of the tables among them, and take the layout the options give. - With
TomlWriteOptions.Keep.NOTHINGit is written entirely in the default style, as an array built with the editing API is.
[[header]]sections is written as those sections, keeping that amount, in the place the first of them had; any other array is written anew on the line it is written on. The amount to keep applies to every table and array nested in this one. A later call keeps the lesser of the two amounts, so a call asking for more than was set changes nothing and a reformat cannot be undone. A copy of this array is reformatted the same way.- Parameters:
keep- How much of the existing structure and format of this array to keep.- Returns:
- This array.
- Throws:
NullPointerException- Ifkeepisnull.
- With
-
copyOf
Create a deep copy of an array.The copy is independent of
array: a nested table or array is copied recursively, and later changes to either are not seen by the other. Every entry of the copy has no input position and reports as modified, since none of it was read from a document; the copy itself reportsisModified()falsewhile it has no entries, likecreate(). The comments attached to each entry, and the unattached comments among the array's elements, are kept.- Parameters:
array- The array to copy.- Returns:
- A new, independent array with the same entries.
- Throws:
IllegalArgumentException- If a value inarraycannot be written as TOML.
-
copyOf
Create an array from anIterable.Any
Iterableis accepted here, not only aCollectionas when one is set as a value: anIterablethat is not aCollectionis rejected as a value, and is converted to an array by passing it here.- Parameters:
values- The values, each converted asadd(Object)converts one.- Returns:
- A new array with one entry per value.
- Throws:
NullPointerException- If a value isnull.IllegalArgumentException- If a value cannot be converted to a TOML value, or cannot be written as TOML.
-
entry
Description copied from interface:TomlArrayGet the entry at an index.The entry is the
TomlEntrythatTomlArray.elements()holds for the index.TomlArray.get(int),TomlArray.inputPositionOf(int)andTomlArray.comments(int)are shortcuts reading its value, position and comments. -
getTable
Description copied from interface:TomlArrayGet a table at a specified index. -
getArray
Description copied from interface:TomlArrayGet an array at a specified index.
-