|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.util.string.AbstractStringList
public abstract class AbstractStringList
An abstract base class for string list implementations. Besides having an implementation for IStringSequence (iterator(), get(int index) and size()), an AbstractStringList can be converted to a String array or a List of Strings.
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 Summary | |
|---|---|
AbstractStringList()
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractStringList()
| Method Detail |
|---|
public abstract IStringIterator iterator()
iterator in interface IStringSequenceIStringSequence.iterator()public abstract int size()
size in interface IStringSequenceIStringSequence.size()public abstract String get(int index)
IStringSequence
get in interface IStringSequenceindex - The index into this string list
IStringSequence.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 use
public 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 use
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||