Question: Implement the static method generateElements declared as follows: / * * * Generates the set of characters in the given { @code String } into
Implement the static method generateElements declared as follows:
Generates the set of characters in the given @code String into the
given @code Set
@param str
the given @code String
@param charSet
the @code Set to be replaced
@replaces charSet
@ensures charSet entriesstr
private static void generateElementsString str Set charSet
Informally, generateElements extracts the characters from the given String and puts them in the given Set. Note that there is no requires clause to rule out repeated characters in str and that charSet is a replacesmode parameter.
Implement the static method nextWordOrSeparator declared as follows:
Returns the first "word" maximal length string of characters not in
@code separators or "separator string" maximal length string of
characters in @code separators in the given @code text starting at
the given @code position
@param text
the @code String from which to get the word or separator
string
@param position
the starting index
@param separators
the @code Set of separator characters
@return the first word or separator string found in @code text starting
at index @code position
@requires position text
@ensures
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
