/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package ws.prova.comparators;

import java.util.Comparator;

import org.mandarax.kernel.ConstantTerm;

public class StringComparator implements Comparator {
	public static StringComparator stringComparator = new StringComparator();
	
	private StringComparator() {};
	
    public int compare(Object o1, Object o2) {
    	if( !(o2 instanceof ConstantTerm) )
    		return -1;
    	if( !(o1 instanceof ConstantTerm) )
    		return 1;
        return String.valueOf(o1).compareTo(String.valueOf(o2));
    }
}

