@ SuppressWarnings ( "unchecked" ) @ Nonnull protected Word < I > concatInternal ( Word < ? extends I > ... words ) { if ( words . length == 0 ) { return this ; } int len = length ( ) ; int totalSize = len ; for ( Word < ? extends I > word : words ) { totalSize += word . length ( ) ; } Object [ ] array = new Object [ totalSize ] ; writeToArray ( 0 , array , 0 , len ) ; int currOfs = len ; for ( Word < ? extends I > w : words ) { int wLen = w . length ( ) ; w . writeToArray ( 0 , array , currOfs , wLen ) ; currOfs += wLen ; } return new SharedWord <> ( array ) ; }
Realizes the concatenation of this word with several other words .