|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.chemistry.opencmis.util.content.LoreIpsum
public class LoreIpsum
A generator of lorem ipsum text ported from the Python implementation at http://code.google.com/p/lorem-ipsum-generator/. Note: original code licensed under the BSD license
Constructor Summary | |
---|---|
LoreIpsum()
Generates random strings of "lorem ipsum" text, based on the word distribution of a sample text, using the words in a dictionary. |
|
LoreIpsum(String sample)
|
|
LoreIpsum(String sample,
String dictionary)
|
|
LoreIpsum(String sample,
String[] dictionary)
|
Method Summary | |
---|---|
static boolean |
contains(String[] array,
String val)
|
String |
generateOneParagraphHtml(int quantity,
boolean startWithLorem)
Generates one paragraph of HTML, surrounded by HTML pararaph tags. |
String |
generateParagraph(boolean opt_startWithLorem)
Generates a single lorem ipsum paragraph, of random length. |
void |
generateParagraphsFullHtml(Appendable writer,
int quantity,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph surrounded by HTML paragraph tags as a full HTML page. |
String |
generateParagraphsFullHtml(int quantity,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph surrounded by HTML paragraph tags as a full HTML page. |
void |
generateParagraphsHtml(Appendable writer,
int quantity,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph surrounded by HTML pararaph tags. |
String |
generateParagraphsHtml(int quantity,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph surrounded by HTML pararaph tags. |
void |
generateParagraphsPlainText(Appendable writer,
int quantity,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph separated by two newlines. |
void |
generateParagraphsPlainText(Appendable writer,
int quantity,
int maxCols,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph separated by two newlines and no line exceeding maxCols columns |
String |
generateParagraphsPlainText(int quantity,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph separated by two newlines. |
String |
generateParagraphsPlainText(int quantity,
int maxCols,
boolean startWithLorem)
Generates a number of paragraphs, with each paragraph separated by two newlines and no line exceeding maxCols columns |
String |
generateSentence(boolean opt_startWithLorem)
Generates a single sentence, of random length. |
String |
getDictionary()
|
String |
getSample()
|
static double |
mean(double[] values)
|
static double |
mean(int[] values)
|
void |
setDictionary(String dictionary)
|
void |
setSample(String sample)
|
static double |
sigma(double[] values)
|
static double |
sigma(int[] values)
|
static double |
sum(double[] values)
|
static int |
sum(int[] values)
|
static double |
variance(double[] values)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoreIpsum()
public LoreIpsum(String sample, String dictionary)
public LoreIpsum(String sample, String[] dictionary)
public LoreIpsum(String sample)
Method Detail |
---|
public String generateParagraph(boolean opt_startWithLorem)
{boolean}
- opt_startWithLorem Whether to start the sentence with
the standard "Lorem ipsum..." first sentence.
public String generateSentence(boolean opt_startWithLorem)
{boolean}
- opt_startWithLorem Whether to start the setnence with
the standard "Lorem ipsum..." first sentence.
public String getSample()
public void setSample(String sample)
public String getDictionary()
public void setDictionary(String dictionary)
public static double mean(int[] values)
public static double mean(double[] values)
public static double variance(double[] values)
public static double sigma(int[] values)
public static double sigma(double[] values)
public static int sum(int[] values)
public static double sum(double[] values)
public static boolean contains(String[] array, String val)
public String generateParagraphsHtml(int quantity, boolean startWithLorem)
quantity
- startWithLorem
-
public void generateParagraphsHtml(Appendable writer, int quantity, boolean startWithLorem) throws IOException
writer
- quantity
- startWithLorem
-
IOException
public String generateOneParagraphHtml(int quantity, boolean startWithLorem)
quantity
- startWithLorem
-
public String generateParagraphsFullHtml(int quantity, boolean startWithLorem)
quantity
- startWithLorem
-
public void generateParagraphsFullHtml(Appendable writer, int quantity, boolean startWithLorem) throws IOException
writer
- quantity
- startWithLorem
-
IOException
public String generateParagraphsPlainText(int quantity, boolean startWithLorem)
quantity
- startWithLorem
-
public void generateParagraphsPlainText(Appendable writer, int quantity, boolean startWithLorem) throws IOException
writer
- quantity
- startWithLorem
-
IOException
public String generateParagraphsPlainText(int quantity, int maxCols, boolean startWithLorem)
quantity
- startWithLorem
-
public void generateParagraphsPlainText(Appendable writer, int quantity, int maxCols, boolean startWithLorem) throws IOException
writer
- quantity
- startWithLorem
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |