Add toStringArray methods.

This commit is contained in:
Christian P. MOMON 2014-12-22 10:48:14 +01:00
parent b0309c80c7
commit 433e405b76

View file

@ -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);
}
/**
*
*/