public TextChunk [ ] splitAt ( int i ) { if ( i < 1 || i >= this . getTextElements ( ) . size ( ) ) { throw new IllegalArgumentException ( ) ; } TextChunk [ ] rv = new TextChunk [ ] { new TextChunk ( this . getTextElements ( ) . subList ( 0 , i ) ) , new TextChunk ( this . getTextElements ( ) . subList ( i , this . getTextElements ( ) . size ( ) ) ) } ; return rv ; }
Splits a TextChunk in two at the position of the i - th TextElement