Home | History | Annotate | Download | only in util
      1 package org.bouncycastle.util;
      2 
      3 /**
      4  * An interface defining a list of strings.
      5  */
      6 public interface StringList
      7     extends Iterable<String>
      8 {
      9     /**
     10      * Add a String to the list.
     11      *
     12      * @param s the String to add.
     13      * @return true
     14      */
     15     boolean add(String s);
     16 
     17     /**
     18      * Get the string at index index.
     19      *
     20      * @param index the index position of the String of interest.
     21      * @return the String at position index.
     22      */
     23     String get(int index);
     24 
     25     int size();
     26 
     27     /**
     28      * Return the contents of the list as an array.
     29      *
     30      * @return an array of String.
     31      */
     32     String[] toStringArray();
     33 
     34     /**
     35      * Return a section of the contents of the list. If the list is too short the array is filled with nulls.
     36      *
     37      * @param from the initial index of the range to be copied, inclusive
     38      * @param to the final index of the range to be copied, exclusive.
     39      * @return an array of length to - from
     40      */
     41     String[] toStringArray(int from, int to);
     42 }
     43