public void formatSpan(int start,int end,EnumSet<FormatType> formatTypes){
  if (start < 0 || start >= mSpannableString.length()) {
    throw new IllegalArgumentException("Invalid start index.");
  }
 else   if (end < start || end > mSpannableString.length()) {
    throw new IllegalArgumentException("Invalid end index.");
  }
  mSpanCount+=formatTypes.size();
  for (  FormatType type : formatTypes) {
    mSpannableString.setSpan(type.getSpan(),start,end,0);
  }
  setText(mSpannableString);
}

public void formatSpan ( int start , int end , EnumSet < FormatType > formatTypes ) { if ( start < 0 || start >= mSpannableString . length ( ) ) { throw new IllegalArgumentException ( "Invalid start index." ) ; } else if ( end < start || end > mSpannableString . length ( ) ) { throw new IllegalArgumentException ( "Invalid end index." ) ; } mSpanCount += formatTypes . size ( ) ; for ( FormatType type : formatTypes ) { mSpannableString . setSpan ( type . getSpan ( ) , start , end , 0 ) ; } setText ( mSpannableString ) ; }
formats a span of text in the text view .
