public final UnicodeSet retain ( CharSequence cs ) { int cp = getSingleCP ( cs ) ; if ( cp < 0 ) { String s = cs . toString ( ) ; boolean isIn = strings . contains ( s ) ; if ( isIn && size ( ) == 1 ) { return this ; } clear ( ) ; strings . add ( s ) ; pat = null ; } else { retain ( cp , cp ) ; } return this ; }
Retain the specified string in this set if it is present . Upon return this set will be empty if it did not contain s or will only contain s if it did contain s .