added castable range method and isCompatible method for domain checking