package com.jxml.quick.qmap;
import java.util.*;

/**
 * Subclasses of QComparable themselves serve as the key in the map container.
 */
public abstract class QComparable implements QKeyed, Comparable
{
	public QComparable(){}

	public QComparable(Map container)
	{
		attach(container);
	}

	public Object key()
	{
		return this;
	}

	public void attach(Map container)
	{
		if (container!=null)
			container.put(this,this);
	}

	public abstract int compareTo(Object o);
}