ISortable

  • Thread starter Thread starter Me
  • Start date Start date
M

Me

I have a class called Page that contains 2 members, TextObjectArray and
ImageObjectArray as follows:

public class Page
{
public Page(int pageN)
{
//
// TODO: Add constructor lmilogic here
//
pageNumber = pageN;
}

private int pageNumber;
private ArrayList textObjectsArray;
private ArrayList imageObjectsArray;
}

I'll need to come up with a method to sort both TextObjectArray and
ImageObjectArray. I was advised to use ISortable interface. Who can
advise me on how to implement the ISortable interface and to use it for
sorting TextObjectArray and ImageObjectArray? Thanks a bunch?
 
I'll need to come up with a method to sort both TextObjectArray and
ImageObjectArray. I was advised to use ISortable interface. Who can
advise me on how to implement the ISortable interface and to use it for
sorting TextObjectArray and ImageObjectArray?

There's no standard ISortable interface. Perhaps you mean IComparable?
ArrayList.Sort will use IComparable if the item implements it (and you
don't specify another IComparer).


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top