@Override @SuppressWarnings("unchecked") protected final void initialize(){
  final int patternSymbolsNum=countPatternSymbols(getPattern());
  if (patternSymbolsNum > 0) {
    setInputs(new Input[patternSymbolsNum]);
    setSegments(new String[patternSymbolsNum + 1]);
    final StringBuilder segmentsBuilder=new StringBuilder();
    final StringBuilder patternBuilder=new StringBuilder(getPattern());
    int segmentCounter=0;
    for (int j=0; j < patternSymbolsNum; j++) {
      int i=0;
      while (patternBuilder.charAt(i) != PATTERN_CHAR) {
        segmentsBuilder.append(patternBuilder.charAt(i));
        i++;
      }
      segments[segmentCounter]=segmentsBuilder.toString();
      segmentsBuilder.setLength(0);
      patternBuilder.delete(0,i + 1);
      addExpressionParams(patternBuilder,segmentCounter);
      segmentCounter++;
    }
    segments[patternSymbolsNum]=patternBuilder.toString();
  }
}

@ Override @ SuppressWarnings ( "unchecked" ) protected final void initialize ( ) { final int patternSymbolsNum = countPatternSymbols ( getPattern ( ) ) ; if ( patternSymbolsNum > 0 ) { setInputs ( new Input [ patternSymbolsNum ] ) ; setSegments ( new String [ patternSymbolsNum + 1 ] ) ; final StringBuilder segmentsBuilder = new StringBuilder ( ) ; final StringBuilder patternBuilder = new StringBuilder ( getPattern ( ) ) ; int segmentCounter = 0 ; for ( int j = 0 ; j < patternSymbolsNum ; j ++ ) { int i = 0 ; while ( patternBuilder . charAt ( i ) != PATTERN_CHAR ) { segmentsBuilder . append ( patternBuilder . charAt ( i ) ) ; i ++ ; } segments [ segmentCounter ] = segmentsBuilder . toString ( ) ; segmentsBuilder . setLength ( 0 ) ; patternBuilder . delete ( 0 , i + 1 ) ; addExpressionParams ( patternBuilder , segmentCounter ) ; segmentCounter ++ ; } segments [ patternSymbolsNum ] = patternBuilder . toString ( ) ; } }
see the description of the parent class ( simpleformattinggenerator )
