|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 java.lang.String |
get(int index)
Gets a string at a given index in the sequence |
abstract IStringIterator |
iterator()
|
java.lang.String |
join()
Joins this sequence of strings using a comma separator. |
java.lang.String |
join(int first,
int last,
java.lang.String separator)
Joins this sequence of strings from first index to last using a separator |
java.lang.String |
join(java.lang.String separator)
Joins this sequence of strings using a separator |
abstract int |
size()
|
java.lang.String[] |
toArray()
Returns this String sequence as an array of Strings. |
java.util.List |
toList()
Returns this String sequence as an array of Strings. |
java.lang.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 IStringSequence
IStringSequence.iterator()
public abstract int size()
size
in interface IStringSequence
IStringSequence.size()
public abstract java.lang.String get(int index)
IStringSequence
get
in interface IStringSequence
index
- The index into this string list
IStringSequence.get(int)
public java.lang.String[] toArray()
public final java.util.List toList()
public int totalLength()
public final java.lang.String join()
public final java.lang.String join(java.lang.String separator)
separator
- The separator to use
public final java.lang.String join(int first, int last, java.lang.String separator)
first
- The first index to use, inclusivelast
- The last index to use, exclusiveseparator
- The separator to use
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |