added more methods

This commit is contained in:
amontano 2005-04-25 09:34:14 +00:00
parent 4f821b7965
commit 1c521d757c

View file

@ -198,6 +198,24 @@ public class SimplifiedLinkedList
return array; return array;
} }
public String[] toReverseStringArray()
{
int n = size();
if (n==0) return null;
Object o;
String array[] = new String[n];
SimplifiedListIterator li = listIterator();
n=0;
while (li.hasNext())
{
o = li.next();
if (o==null) array[n]=null;
else array[n] = o.toString();
n++;
}
return array;
}
public void write(PrintWriter pw) public void write(PrintWriter pw)
{ {
SimplifiedListIterator li = listIterator(); SimplifiedListIterator li = listIterator();