public boolean isPrefixOf ( Word < ? > other ) { int len = length ( ) , otherLen = other . length ( ) ; if ( otherLen < len ) { return false ; } for ( int i = 0 ; i < len ; i ++ ) { I sym1 = getSymbol ( i ) ; Object sym2 = other . getSymbol ( i ) ; if ( ! Objects . equals ( sym1 , sym2 ) ) { return false ; } } return true ; }
Checks if this word is a prefix of another word .