package wordcram; /** * A WordSizer tells WordCram how big to render each word. * You'll pass a WordSizer to WordCram via {@link WordCram#withSizer(WordSizer)}. *

* Some useful implementations are available in {@link Sizers}. * * @author Dan Bernier */ public interface WordSizer { /** * How big should this {@link Word} be rendered? *

* Generally, a word cloud draws more important words bigger. Two typical * ways to measure word's importance are its weight, and its rank (its * position in the list of words, sorted by weight). *

* Given that, sizeFor is passed the Word (which knows its own weight), its * rank, and the total number of words. *

* For example, given the text "I think I can I think", the words would look * like this: *

* ...and the WordSizer would be called with the following values: * * * @param word * the Word to determine the size of * @param wordRank * the rank of the Word * @param wordCount * the total number of Words being rendered * @return the size to render the Word */ public float sizeFor(Word word, int wordRank, int wordCount); }