commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <John.E.Gr...@wellsfargo.com>
Subject RE: [Not sure] - "GenericComparator"
Date Fri, 15 Apr 2005 19:44:17 GMT
Check out org.apache.commons.beanutils.BeanComparator.


-----Original Message-----
From: Scovetta, Michael V [mailto:Michael.Scovetta@ca.com] 
Sent: Friday, April 15, 2005 2:30 PM
To: Jakarta Commons Users List
Subject: [Not sure] - "GenericComparator"


Hello-

I'm looking for something that'll let me sort objects based on one or more properties:

	GenericComparator gc = new GenericComparator(myObject.class);
	gc.addField("field1");
	gc.addField(field2);
	gc.addMethod("method1");

	Collections.sort(myVector, gc);

I'd expect the functionality to be such that myVector is made up of myObjects, and myObjects
have fields field1 and field2, and method method1(). If a.field1 > b.field1, then a >
b. If a.field1 == b.field1, then move on to field2, etc.

Does anyone know if this functionality exists in any of the Jakarta tools?

Thanks!

Michael Scovetta
Computer Associates
Senior Application Developer
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message