Read the API doc for the classes you are using and see if any one them will do what you want.
That's what I'd have to do to see if there was a method that would work.