package org.logical_paradox.fts;

import java.util.Comparator;

public class KeywordLocationComparator implements Comparator {
	private static KeywordLocationComparator cp = new KeywordLocationComparator();

	protected KeywordLocationComparator() {
	}
	public static KeywordLocationComparator getComparator() {
		return cp;
	}
	public int compare( Object o1, Object o2 ) {
		KeywordLocation k1 = (KeywordLocation)o1;
		KeywordLocation k2 = (KeywordLocation)o2;

		if( k1._pos == k2._pos ) {
			return 0;
		} else if( k1._pos < k2._pos ) {
			return -1;
		} else {
			return 1;
		}
	}
}

// end of KeywordLocationComparator.java
