helper
Class BloodTypeServices

java.lang.Object
  extended by helper.BloodTypeServices

public class BloodTypeServices
extends java.lang.Object


Constructor Summary
BloodTypeServices()
           
 
Method Summary
static boolean isCompatible(java.lang.String motherBloodType, java.lang.String fatherBloodType, java.lang.String childBloodType)
          Determines whether the blood type of the child is consistent genetically with the blood types of the mother and father
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BloodTypeServices

public BloodTypeServices()
Method Detail

isCompatible

public static boolean isCompatible(java.lang.String motherBloodType,
                                   java.lang.String fatherBloodType,
                                   java.lang.String childBloodType)
                            throws java.lang.RuntimeException
Determines whether the blood type of the child is consistent genetically with the blood types of the mother and father

Parameters:
motherBloodType - a string representing a blood type, which must be one of A, B, AB, or O (case insenstive)
fatherBloodType - a string representing a blood type, which must be one of A, B, AB, or O (case insenstive)
childBloodType - a string representing a blood type, which must be one of A, B, AB, or O (case insenstive)
Returns:
a boolean value that is true if and only if the blood type of the child is consistent genetically with the blood types of the mother and father
Throws:
java.lang.RuntimeException - if any of the passed parameters are not valid blood types, according to the specification above. The message of the thrown exception will be "Invalid blood type!".