@Test public void testMapCourseOverGroundToCategory() { assertEquals(1, Categorizer.mapCourseOverGroundToCategory((float) 0.0)); assertEquals(1, Categorizer.mapCourseOverGroundToCategory((float) 29.999)); assertEquals(2, Categorizer.mapCourseOverGroundToCategory((float) 30.0)); assertEquals(12, Categorizer.mapCourseOverGroundToCategory((float) 359.999)); assertEquals(1, Categorizer.mapCourseOverGroundToCategory((float) 360.000)); }
public static short mapCourseOverGroundToCategory(float cog) { cog = cog % (float) 360.0; return (short) ((short) (cog / 30) + 1); }
Categorizer { public static short mapCourseOverGroundToCategory(float cog) { cog = cog % (float) 360.0; return (short) ((short) (cog / 30) + 1); } }
Categorizer { public static short mapCourseOverGroundToCategory(float cog) { cog = cog % (float) 360.0; return (short) ((short) (cog / 30) + 1); }  }
Categorizer { public static short mapCourseOverGroundToCategory(float cog) { cog = cog % (float) 360.0; return (short) ((short) (cog / 30) + 1); }  static short mapShipTypeToCategory(int shipType); static short mapShipLengthToCategory(int shipLength); static short mapCourseOverGroundToCategory(float cog); static short mapSpeedOverGroundToCategory(float sog); static String mapShipTypeCategoryToString(short category); static String mapShipSizeCategoryToString(short category); static String mapCourseOverGroundCategoryToString(short category); static String mapSpeedOverGroundCategoryToString(short category); static Map<Short, String> getAllShipTypeCategoryMappings(); static Map<Short, String> getAllShipSizeCategoryMappings(); static Map<Short, String> getAllCourseOverGroundCategoryMappings(); static Map<Short, String> getAllSpeedOverGroundCategoryMappings(); }
Categorizer { public static short mapCourseOverGroundToCategory(float cog) { cog = cog % (float) 360.0; return (short) ((short) (cog / 30) + 1); }  static short mapShipTypeToCategory(int shipType); static short mapShipLengthToCategory(int shipLength); static short mapCourseOverGroundToCategory(float cog); static short mapSpeedOverGroundToCategory(float sog); static String mapShipTypeCategoryToString(short category); static String mapShipSizeCategoryToString(short category); static String mapCourseOverGroundCategoryToString(short category); static String mapSpeedOverGroundCategoryToString(short category); static Map<Short, String> getAllShipTypeCategoryMappings(); static Map<Short, String> getAllShipSizeCategoryMappings(); static Map<Short, String> getAllCourseOverGroundCategoryMappings(); static Map<Short, String> getAllSpeedOverGroundCategoryMappings(); static final int NUM_SHIP_TYPE_CATEGORIES; static final int NUM_SHIP_SIZE_CATEGORIES; static final int NUM_COURSE_OVER_GROUND_CATEGORIES; static final int NUM_SPEED_OVER_GROUND_CATEGORIES; }