@ Nonnull public Word < I > longestCommonSuffix ( Word < ? > other ) { int len = length ( ) , otherLen = other . length ( ) ; int minLen = ( len < otherLen ) ? len : otherLen ; int idx1 = len , idx2 = otherLen ; int i = 0 ; while ( i < minLen ) { I sym1 = getSymbol ( -- idx1 ) ; Object sym2 = other . getSymbol ( -- idx2 ) ; if ( ! Objects . equals ( sym1 , sym2 ) ) { break ; } i ++ ; } return suffix ( i ) ; }
Determines the longest common suffix of this word and another word .