fromValue static method

SubjectPosition fromValue(
  1. int value
)

Creates an enumeration value from int. param value The int value. return The created SubjectPosition.

Implementation

static SubjectPosition fromValue(int value) {
    	switch (value) {
      	case 0xFF:
        	return SubjectPosition.undefined;
      	case 0x00:
        	return SubjectPosition.correct;
      	case 0x01:
        	return SubjectPosition.tooClose;
      	case 0x02:
        	return SubjectPosition.tooFar;
      	case 0x04:
        	return SubjectPosition.tooLeft;
      	case 0x08:
        	return SubjectPosition.tooRight;
      	case 0x10:
        	return SubjectPosition.tooHigh;
      	case 0x20:
        	return SubjectPosition.tooLow;
    default:
        	throw Exception("Unable to find the specified enum value for $value");
    	}
  	}