This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I'm playing with some code that will read a text file and then write the text (paragraph) from that text file to a jpeg.
I understand that I need to use LineBreakMeasurer and that it requires (AttributedCharacterStringIterator as a parameter, but I can't wrap my head around how it all works together or what I need to do. I also can't find any very good examples.
Can someone check my understanding? By my reckoning . . .
LineBreakMeasurer requires the interface AttributedCharacterStringIterator because it uses the methods of AttributedCharacterIterator to determine line length, etc. But some of the wording of the methods suggest that AttributedCharacterIterator needs to do some of the work. For instance:
Returns the index of the first character of the run with respect to all attributes containing the current character.
Suggests to me that the "run" is the characters already processed and the "first character of the run" would be the first character in the next line of data to be processed (as opposed to the first character of the string).
Am I over thinking this?
I would greatly appreciate it if someone helped me understand what I need to do to even begin the code.