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

ObjectNameComparator

public final class ObjectNameComparator extends Object implements Comparator

Fields Summary
public static final ObjectNameComparator
INSTANCE
Constructors Summary
private ObjectNameComparator()

	
			
Methods Summary
public intcompare(javax.management.ObjectName o1, javax.management.ObjectName o2)

	    int result  = 0;
	    
	    if ( o1 == null && o2 == null )
	    {
	        result  = 0;
	    }
	    else if ( o1 == null )
	    {
	        result  = -1;
	    }
	    else if ( o2 == null )
	    {
	        result  = 1;
	    }
	    else
	    {
    		final String name1	= JMXUtil.toString( o1 );
    		final String name2	= JMXUtil.toString( o2 );
    		
    		result  = name1.toString().compareTo( name2.toString() );
		}
		
		return result;
	
public booleanequals(java.lang.Object other)

		return( other instanceof ObjectNameComparator );