FileDocCategorySizeDatePackage
MBeanOperationInfoComparator.javaAPI DocGlassfish v2 API3662Fri May 04 22:31:04 BST 2007com.sun.appserv.management.util.jmx

MBeanOperationInfoComparator

public final class MBeanOperationInfoComparator extends Object implements Comparator
Caution: this Comparator may be inconsistent with equals() because it ignores the description.

Fields Summary
private static final com.sun.appserv.management.util.jmx.stringifier.MBeanOperationInfoStringifier
OPERATION_INFO_STRINGIFIER
public static final MBeanOperationInfoComparator
INSTANCE
Constructors Summary
private MBeanOperationInfoComparator()

	
			
Methods Summary
public intcompare(javax.management.MBeanOperationInfo info1, javax.management.MBeanOperationInfo info2)

		final MBeanOperationInfoStringifier	sf	= OPERATION_INFO_STRINGIFIER;
		
		// we just want to sort based on name and signature; there can't be two operations with the
		// same name and same signature, so as long as we include the name and signature the
		// sorting will always be consistent.
		int	c	= info1.getName().compareTo( info2.getName() );
		if ( c == 0 )
		{
			// names the same, subsort on signature, first by number of params
			c	= info1.getSignature().length - info2.getSignature().length;
			if ( c == 0 )
			{
				// names the same, subsort on signature, first by number of params
				c	= sf.getSignature( info1 ).compareTo( sf.getSignature( info2 ) );
			}
			
		}
		
		return( c );
	
public booleanequals(java.lang.Object other)

		return( other instanceof MBeanOperationInfoComparator );