@Override
  public void doAction(char cha) throws SimplePolymerSectionException {

    /* repeating information is finished */
    if (cha == '\'') {
      if (_parser.checkRepeating(repeating)) {
        String[] range = repeating.split("-");
        int first = Integer.parseInt(range[0]);
        if (range.length > 1) {
          int second = Integer.parseInt(range[1]);
          /* range is wrong */
          if (second - first <= 0) {
            LOG.error("Information about repeating is wrong: " + repeating);
            throw new SimplePolymerSectionException("Information about repeating is wrong: " + repeating);
          } else {
            LOG.info("Monomer unit is repeated:");
            _parser.notationContainer.getCurrentPolymer().getPolymerElements().getCurrentMonomerNotation().setCount(repeating);
            _parser.setState(new BetweenMonomerParser(_parser));
          }

        } else {
          LOG.info("Monomer unit is repeated:");
          _parser.notationContainer.getCurrentPolymer().getPolymerElements().getCurrentMonomerNotation().setCount(repeating);
          _parser.setState(new BetweenMonomerParser(_parser));
        }

      } else {
        LOG.error("Information about repeating is wrong: " + repeating);
        throw new SimplePolymerSectionException("Information about repeating is wrong: " + repeating);
      }
    } /* add characters to repeating information */ else {
      repeating += cha;
    }
  }
@Override
  public void doAction(char cha) throws SimplePolymerSectionException {

    
    if (cha == '\'') {
      if (_parser.checkRepeating(repeating)) {
        String[] range = repeating.split("-");
        int first = Integer.parseInt(range[0]);
        if (range.length > 1) {
          int second = Integer.parseInt(range[1]);
          
          if (second - first <= 0) {
            LOG.error("Information about repeating is wrong: " + repeating);
            throw new SimplePolymerSectionException("Information about repeating is wrong: " + repeating);
          } else {
            LOG.info("Monomer unit is repeated:");
            _parser.notationContainer.getCurrentPolymer().getPolymerElements().getCurrentMonomerNotation().setCount(repeating);
            _parser.setState(new BetweenMonomerParser(_parser));
          }

        } else {
          LOG.info("Monomer unit is repeated:");
          _parser.notationContainer.getCurrentPolymer().getPolymerElements().getCurrentMonomerNotation().setCount(repeating);
          _parser.setState(new BetweenMonomerParser(_parser));
        }

      } else {
        LOG.error("Information about repeating is wrong: " + repeating);
        throw new SimplePolymerSectionException("Information about repeating is wrong: " + repeating);
      }
    }  else {
      repeating += cha;
    }
  }
@ Override public void doAction ( char cha ) throws SimplePolymerSectionException { /* repeating information is finished */ if ( cha == ' ' ) { if ( _parser . checkRepeating ( repeating ) ) { String [ ] range = repeating . split ( "-" ) ; int first = Integer . parseInt ( range [ 0 ] ) ; if ( range . length > 1 ) { int second = Integer . parseInt ( range [ 1 ] ) ; /* range is wrong */ if ( second - first <= 0 ) { LOG . error ( "Information about repeating is wrong: " + repeating ) ; throw new SimplePolymerSectionException ( "Information about repeating is wrong: " + repeating ) ; } else { LOG . info ( "Monomer unit is repeated:" ) ; _parser . notationContainer . getCurrentPolymer ( ) . getPolymerElements ( ) . getCurrentMonomerNotation ( ) . setCount ( repeating ) ; _parser . setState ( new BetweenMonomerParser ( _parser ) ) ; } } else { LOG . info ( "Monomer unit is repeated:" ) ; _parser . notationContainer . getCurrentPolymer ( ) . getPolymerElements ( ) . getCurrentMonomerNotation ( ) . setCount ( repeating ) ; _parser . setState ( new BetweenMonomerParser ( _parser ) ) ; } } else { LOG . error ( "Information about repeating is wrong: " + repeating ) ; throw new SimplePolymerSectionException ( "Information about repeating is wrong: " + repeating ) ; } } /* add characters to repeating information */ else { repeating += cha ; } }
{@inheritDoc}
{