I think changes required in below two methods and constructor:
1. Instead of define big size like 200K define small size say 10 in constructor.Big size may create performance problem.
2. In SetSorted() method, why this "if(data.length <= 1)" condition is required. Please remove this condition.
3. In AddItem() method , Once the max limit is reached, you need to create a Temp String array and assign the old String values to it, and create a data String array with new limit, and get the old values assigned back to data array, for example:
if (length == maximum)
{
String[] tempData = new String[length];
tempData = data;
maximum += 10;
data = new String[maximum];
for (int i=0; i<tempData.length; i++)
data[i] = tempData[i];
tempData = null;
}
And also removed SetSorted() from AddItem() method.
I feel instead of using String you can use StringBuffer.
Regards,
Panduranga.