reset password
Author Message
stridhiryu030363
Posts: 37
Posted 22:42 Jan 31, 2012 |

How did you guys go about doing this? I tried reversing the order of the list but that just mixes everything up when the command is used every time the Pagelist is called.

Last edited by stridhiryu030363 at 22:45 Jan 31, 2012.
cysun
Posts: 2935
Posted 07:48 Feb 01, 2012 |

For this assignment it's probably enough to just display the page list in reverse order (assuming you use a List). For example:

for( int i=pages.size()-1 ; i >= 0 ; --i )

{

    // display pages.get(i)

}

For the next assignment where pages can be edited and the listing should be based on the last-edited-time, you may want to have the WikiPage class implements the Comparable interface then use Collections.sort() to sort them before displaying.