StringList (jEdit API Documentation)

Package org.gjt.sp.util

## Class StringList

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.ArrayList<java.lang.String>
      - - org.gjt.sp.util.StringList

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Cloneable`, `java.lang.Iterable<java.lang.String>`, `java.util.Collection<java.lang.String>`, `java.util.List<java.lang.String>`, `java.util.RandomAccess`

      public class StringList
      extends java.util.ArrayList<java.lang.String>

  A List<String> with some perl-like convenience functions (split/join primarily), and easy conversion to/from arrays.
  Since:
    jEdit 4.3pre7
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StringList()` |
    `StringList​(java.lang.Object[] array)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAll​(java.lang.Object[] array)` |
    `static java.lang.String` | `join​(java.lang.Object[] arr, java.lang.String delim)` |
    `java.lang.String` | `join​(java.lang.String delim)` | Non-static version, that joins "this" StringList.
    `static java.lang.String` | `join​(java.util.Collection<java.lang.String> c, java.lang.String delim)` | Deprecated. use `String.join(CharSequence, CharSequence...)` or `String.join(CharSequence, Iterable)`, thos methods are available since Java 8 and are faster in all situations
    `static StringList` | `split​(java.lang.String orig, java.lang.Object delim)` |
    `java.lang.String[]` | `toArray()` |
    `java.lang.String` | `toString()` | Joins each string in the list with a newline.

    - ### Methods inherited from class java.util.ArrayList

      `add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream, toArray`

    - ### Methods inherited from interface java.util.List

      `containsAll`

- - ### Constructor Detail

    - #### StringList

          public StringList()

    - #### StringList

          public StringList​(java.lang.Object[] array)

  - ### Method Detail

    - #### addAll

          public void addAll​(java.lang.Object[] array)

    - #### split

          public static StringList split​(java.lang.String orig,
                                         java.lang.Object delim)

      Parameters:
        `orig` - the original string
        `delim` - a delimiter to use for splitting
      Returns:
        a new StringList containing the split strings.

    - #### toString

          public java.lang.String toString()

      Joins each string in the list with a newline.
      Overrides:
        `toString` in class `java.util.AbstractCollection<java.lang.String>`
      Returns:
        a joined string representation of this, with the newline (\n) as delimiter.

    - #### toArray

          @Nonnull
          public java.lang.String[] toArray()

      Specified by:
        `toArray` in interface `java.util.Collection<java.lang.String>`
      Specified by:
        `toArray` in interface `java.util.List<java.lang.String>`
      Overrides:
        `toArray` in class `java.util.ArrayList<java.lang.String>`
      Returns:
        an array of String

    - #### join

          @Deprecated
          public static java.lang.String join​(java.util.Collection<java.lang.String> c,
                                              java.lang.String delim)

      Deprecated.
      use `String.join(CharSequence, CharSequence...)` or `String.join(CharSequence, Iterable)`, thos methods are available since Java 8 and are faster in all situations
      The reverse of split - given a collection, takes each element and places it in a string, joined by a delimiter.

    - #### join

          public static java.lang.String join​(java.lang.Object[] arr,
                                              java.lang.String delim)

      Parameters:
        `arr` - array of objects
        `delim` - delimiter to separate strings
      Returns:
        a single string with each element in arr converted to a string and concatenated, separated by delim.

    - #### join

          public java.lang.String join​(java.lang.String delim)

      Non-static version, that joins "this" StringList.
      Parameters:
        `delim` - the delimiter
      Returns:
        a joined string with delim inbetween each element