Sorting of a Collection
I have a collection of Objects of a Class, this Object contains another collection within it. i.e Class A contains a collection of Class B objs.
Now I want to sort elements of Collection B and based on its probability sort collection A ......I have an object C of same type as obj B of same class say B . Now I need to iterate through the collection B and compare values in obj B and C and accordingly sort B based on most number of matched found. Based on comparision of B and C I need to decide how A would be sorted .......
I have
A -- a1b1(Obj of B)
b2 (Obj of B)
b3 (Obj of B)
A - a2b1
b2
b3
c (Obj og B) .....
if c.x = b1.x and c.y = b1.y than b1 is should come at the top of the list.
if c.x =b.x and c.x != b1.y than it has less priority than the condition above . accordingly I need to sort b1,b2 and b3 within a1 ......
If I see that all b1,b2 and b3 for a1 are equal to x,y for c than a1 also holds a high priority and accordingly I need to sort A..
Please let me know some also using which I can sort this.

