@Override public void validate(){
  super.validate();
switch (barrierType) {
case DownIn:
case UpIn:
case DownOut:
case UpOut:
    break;
default :
  throw new LibraryException(UNKNOWN_TYPE);
}
QL.require(!Double.isNaN(barrier),"no barrier given");
QL.require(!Double.isNaN(rebate),"no rebate given");
}

@ Override public void validate ( ) { super . validate ( ) ; switch ( barrierType ) { case DownIn : case UpIn : case DownOut : case UpOut : break ; default : throw new LibraryException ( UNKNOWN_TYPE ) ; } QL . require ( ! Double . isNaN ( barrier ) , "no barrier given" ) ; QL . require ( ! Double . isNaN ( rebate ) , "no rebate given" ) ; }
this method performs additional validation of needed to conform to the barrier type . the validation is done by comparing the underlying price against the barrier type .
