Add toStringArray methods.
This commit is contained in:
parent
b0309c80c7
commit
433e405b76
1 changed files with 40 additions and 1 deletions
|
@ -732,6 +732,25 @@ public class StringList extends ArrayList<String> implements CharSequence
|
|||
return (result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String[] toStringArray()
|
||||
{
|
||||
String[] result;
|
||||
|
||||
result = new String[this.size()];
|
||||
|
||||
for (int index = 0; index < size(); index++)
|
||||
{
|
||||
result[index] = get(index);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -826,7 +845,7 @@ public class StringList extends ArrayList<String> implements CharSequence
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* This method converts a string array to a string.
|
||||
*/
|
||||
public static String toString(final String[] source)
|
||||
{
|
||||
|
@ -845,6 +864,26 @@ public class StringList extends ArrayList<String> implements CharSequence
|
|||
return (result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method converts a StringList to an array of String.
|
||||
*/
|
||||
public static String[] toStringArray(final StringList source)
|
||||
{
|
||||
String[] result;
|
||||
|
||||
if (source == null)
|
||||
{
|
||||
result = new String[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = source.toStringArray();
|
||||
}
|
||||
|
||||
//
|
||||
return (result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue