Interface StringList

  • All Implemented Interfaces:
    java.lang.Iterable

    
    public interface StringList
     implements Iterable<T>
                        

    An interface defining a list of strings.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract boolean add(String s) Add a String to the list.
      abstract String get(int index) Get the string at index index.
      abstract int size()
      abstract Array<String> toStringArray() Return the contents of the list as an array.
      abstract Array<String> toStringArray(int from, int to) Return a section of the contents of the list.
      • Methods inherited from class java.lang.Iterable

        forEach, iterator, spliterator
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • add

         abstract boolean add(String s)

        Add a String to the list.

        Parameters:
        s - the String to add.
        Returns:

        true

      • get

         abstract String get(int index)

        Get the string at index index.

        Parameters:
        index - the index position of the String of interest.
        Returns:

        the String at position index.

      • size

         abstract int size()
      • toStringArray

         abstract Array<String> toStringArray()

        Return the contents of the list as an array.

        Returns:

        an array of String.

      • toStringArray

         abstract Array<String> toStringArray(int from, int to)

        Return a section of the contents of the list. If the list is too short the array is filled with nulls.

        Parameters:
        from - the initial index of the range to be copied, inclusive
        to - the final index of the range to be copied, exclusive.
        Returns:

        an array of length to - from