public IntegerOrPercentage(final String s){
  final int pos=s.indexOf('%');
  if (pos >= 0) {
    mValue=Integer.parseInt(s.substring(0,pos));
    mIsPercentage=true;
  }
 else {
    mValue=Integer.parseInt(s);
    mIsPercentage=false;
  }
}

public IntegerOrPercentage ( final String s ) { final int pos = s . indexOf ( '%' ) ; if ( pos >= 0 ) { mValue = Integer . parseInt ( s . substring ( 0 , pos ) ) ; mIsPercentage = true ; } else { mValue = Integer . parseInt ( s ) ; mIsPercentage = false ; } }
constructs a new integerorpercentage based on the supplied string . if the string ends with " % " , it is a percentage , otherwise an absolute value .
