/** * Jeff Rupp * Master's Thesis * 2005 * * Created this class instead of using one of the built in java classes to * be able to store in a sorted set, needed comparable, * * and because java.awt.geom.Point2D.Float getX, getY return doubles */ package jdr.utils; public class FloatPoint implements java.lang.Comparable { private float m_x = 0; private float m_y = 0; public FloatPoint() { } public FloatPoint(float x, float y) { m_x = x; m_y = y; } public void setLocation(float x, float y) { m_x = x; m_y = y; } public float getX() { return m_x; } public float getY() { return m_y; } public int compareTo(Object o) { int retVal = 0; if(o instanceof FloatPoint) { retVal = (int)(m_x - ((FloatPoint)o).getX()); } return retVal; } public String toString() { return "x: "+m_x+" y: "+m_y; } }