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
 
Back
Top