public class TypeConverter extends Object
Modifier and Type | Field and Description |
---|---|
static int |
NO_MODE_PASSED
Int to represent what happens when the mode passed is the value "Modes" from the mode box
|
Constructor and Description |
---|
TypeConverter() |
Modifier and Type | Method and Description |
---|---|
static String |
convertColorToString(int colorID) |
static int |
findModeFromString(String mode)
Converts the NAME of a mode in Constants to an int that the sensor
classes use to represent the mode
|
static String |
findNameFromMode(int mode) |
static RemoteMotor |
getMotorFromPortName(String port) |
static int |
getRowFromMotorPort(char id) |
static SensorPort |
identifySensorPortFromName(String port) |
static String |
identifySensorPortName(SensorPort port) |
static Sensor |
identifySensorTypeFromName(String selectedType,
SensorPort port) |
public static final int NO_MODE_PASSED
public static SensorPort identifySensorPortFromName(String port)
port
- either S1, S2, S3 or S4IllegalArgumentException
- if the NAME isn't one of the specified
namespublic static String identifySensorPortName(SensorPort port)
public static int findModeFromString(String mode)
mode
- the mode as a stringConstants
public static String findNameFromMode(int mode)
public static Sensor identifySensorTypeFromName(String selectedType, SensorPort port)
public static RemoteMotor getMotorFromPortName(String port)
public static String convertColorToString(int colorID)
public static int getRowFromMotorPort(char id)