public abstract class AbstractStringList extends Object implements IStringSequence, Serializable
The total length of all Strings in the list can be determined by calling totalLength().
Strings or a subset of Strings in the list can be formatted using three join() methods:
Constructor and Description |
---|
AbstractStringList() |
Modifier and Type | Method and Description |
---|---|
abstract String |
get(int index)
Gets a string at a given index in the sequence
|
abstract IStringIterator |
iterator() |
String |
join()
Joins this sequence of strings using a comma separator.
|
String |
join(int first,
int last,
String separator)
Joins this sequence of strings from first index to last using a separator
|
String |
join(String separator)
Joins this sequence of strings using a separator
|
abstract int |
size() |
String[] |
toArray()
Returns this String sequence as an array of Strings.
|
List<String> |
toList()
Returns this String sequence as an array of Strings.
|
String |
toString()
Converts this object to a string representation
|
int |
totalLength() |
public abstract IStringIterator iterator()
iterator
in interface IStringSequence
IStringSequence.iterator()
public abstract int size()
size
in interface IStringSequence
IStringSequence.size()
public abstract String get(int index)
IStringSequence
get
in interface IStringSequence
index
- The index into this string listIStringSequence.get(int)
public String[] toArray()
public final List<String> toList()
public int totalLength()
public final String join()
public final String join(String separator)
separator
- The separator to usepublic final String join(int first, int last, String separator)
first
- The first index to use, inclusivelast
- The last index to use, exclusiveseparator
- The separator to useCopyright © 2006–2022 Apache Software Foundation. All rights reserved.