// (C)2007 Attila Kovacs <attila@submm.caltech.edu>


import java.text.*;

public class HourAngleFormat extends TimeFormat {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -6260375852141250856L;
	
	public HourAngleFormat() { super(); setOneSided(true); }
	
	public HourAngleFormat(DecimalFormat df) { super(df); setOneSided(true); }
	
	public HourAngleFormat(int decimals) { super(decimals); setOneSided(true); }
	
	@Override
	public StringBuffer format(double angle, StringBuffer toAppendTo, FieldPosition pos) {
		return super.format(angle / Unit.timeAngle, toAppendTo, pos);
	}
	
	@Override
	public Number parse(String source, ParsePosition parsePosition) {
		return super.parse(source, parsePosition).doubleValue() * Unit.timeAngle;
	}	

}
