return the line number that contains the offset.
return the offset of the last character of the line.
return the offset of the first character of the line. See javax.swing.text.Utilities, it's the same thing.
look for adjacent whitespace to identify the word at the location.