public FormatResult applyMask(String mask,String value,String oldValue,Integer cursorIndex){
  if (mask == null || value == null) {
    return null;
  }
  if (oldValue.length() > value.length()) {
    return new FormatResult(value,null);
  }
  value=(String)getMaskOrGetCursorIndex(mask,value,cursorIndex,true);
  cursorIndex=(Integer)getMaskOrGetCursorIndex(mask,value,cursorIndex,false);
  return new FormatResult(value,cursorIndex);
}

public FormatResult applyMask ( String mask , String value , String oldValue , Integer cursorIndex ) { if ( mask == null || value == null ) { return null ; } if ( oldValue . length ( ) > value . length ( ) ) { return new FormatResult ( value , null ) ; } value = ( String ) getMaskOrGetCursorIndex ( mask , value , cursorIndex , true ) ; cursorIndex = ( Integer ) getMaskOrGetCursorIndex ( mask , value , cursorIndex , false ) ; return new FormatResult ( value , cursorIndex ) ; }
will apply a mask a returns formatresult
