// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) fieldsfirst 
// Source File Name:   MathAxisMapper.java

package lt.monarch.charts;


// Referenced classes of package lt.monarch.charts:
//			AxisMapper, NormalizedRange

public class MathAxisMapper
	implements AxisMapper
{

	public NormalizedRange range;

	public MathAxisMapper()
	{
		range = new NormalizedRange();
	}

	public String formatKey(Object obj)
	{
		return range.formatPrecise(((Double)obj).doubleValue());
	}

	public String label(int i)
	{
		return range.format(range.min() + range.step() * (double)i);
	}

	public int labelCount()
	{
		return range.steps();
	}

	public int map(int i, Object obj)
	{
		return range.map(i, ((Double)obj).doubleValue());
	}

	public int mapLabel(int i, int j)
	{
		return (i * j) / (labelCount() - 1);
	}

	public void prepare()
	{
		range.normalize();
	}

	public void registerKey(Object obj)
	{
		double d = ((Double)obj).doubleValue();
		range.updateRange(d);
	}
}
