Project Wonder 5.0.0.8787

er.extensions.components
Class ERXLoremIpsumGenerator

java.lang.Object
  extended by er.extensions.components.ERXLoremIpsumGenerator

public class ERXLoremIpsumGenerator
extends Object

Provides a generator for Lorem Ipsum text.

Author:
Brooks Hollar

Field Summary
static String PARAGRAPH
           
static String SENTENCE
           
static String WORD
           
 
Constructor Summary
ERXLoremIpsumGenerator()
           
 
Method Summary
static String all()
          Returns the entire Lorem text.
static String firstParagraph()
          Returns the first paragram from Lorem Ipsum text.
static String firstSentence()
          Returns the first sentence of the first paragraph from Lorem text.
static String generate(String type, int count)
          Generates lorem ipsum text using an enumerated type.
static String[] list(int size)
          Returns a list of single sentences from the Lorem text.
static String[] list(int size, int numberOfSentences)
          Returns a list of a given number of sentences from the Lorem text.
static String paragraph()
          Returns a random paragraph of Lorem text.
static String paragraph(int number)
          Returns a particular paragraph from Lorem text.
static String paragraphs(int numParagraphs)
          Returns any number of random paragraphs of Lorem text.
static String randomSentence()
          Returns a random sentence from the Lorem text.
static String sentences(int numberSentences)
          Returns a given number of random sentences from the Lorem text.
static String word()
          Returns a single, randomly choosen, lowercase word from Lorem text.
static String words(int numWords)
          Returns a specific number of random, lowercase, space-delimited words from Lorem text.
static String words(int min, int max)
          Returns a number of random, lowercase, space-delimited words between min and max.
static String words(int min, int max, int maxLength)
          Returns a number of random, lowercase, space-delimited words between min and max.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAGRAPH

public static final String PARAGRAPH
See Also:
Constant Field Values

SENTENCE

public static final String SENTENCE
See Also:
Constant Field Values

WORD

public static final String WORD
See Also:
Constant Field Values
Constructor Detail

ERXLoremIpsumGenerator

public ERXLoremIpsumGenerator()
Method Detail

all

public static String all()
Returns the entire Lorem text.

Returns:
a string of all ten paragraphs of Lorem

firstParagraph

public static String firstParagraph()
Returns the first paragram from Lorem Ipsum text.

Returns:
a string of the first paragraph of Lorem

firstSentence

public static String firstSentence()
Returns the first sentence of the first paragraph from Lorem text.

Returns:
the string "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."

list

public static String[] list(int size)
Returns a list of single sentences from the Lorem text.

Parameters:
size - the number of items to insert into the list
Returns:
an array of strings of single sentences

list

public static String[] list(int size,
                            int numberOfSentences)
Returns a list of a given number of sentences from the Lorem text.

Parameters:
size - the number of items to insert into the list
Returns:
an array of strings of sentences

paragraph

public static String paragraph()
Returns a random paragraph of Lorem text.

Returns:
a string of one random paragraph of Lorem

paragraph

public static String paragraph(int number)
Returns a particular paragraph from Lorem text.

Parameters:
number - the paragraph number to return, should be between 0 and 9
Returns:
a string of a particular Lorem paragraph

paragraphs

public static String paragraphs(int numParagraphs)
Returns any number of random paragraphs of Lorem text.

Parameters:
numParagraphs - the number of paragraphs to return
Returns:
a string of a number of Lorem paragraphs, each seperated by a blank line.

randomSentence

public static String randomSentence()
Returns a random sentence from the Lorem text.

Returns:
a string of a random sentence

sentences

public static String sentences(int numberSentences)
Returns a given number of random sentences from the Lorem text.

Parameters:
numberSentences - the number of sentences to select
Returns:
a string of a given number of randomly choosen sentences.

word

public static String word()
Returns a single, randomly choosen, lowercase word from Lorem text.

Returns:
a string of a single, random word

words

public static String words(int numWords)
Returns a specific number of random, lowercase, space-delimited words from Lorem text.

Parameters:
numWords - the number of words to return
Returns:
a string of space-delimited words

words

public static String words(int min,
                           int max,
                           int maxLength)
Returns a number of random, lowercase, space-delimited words between min and max.

Parameters:
min - the minimum number of words
max - the maximum nunmber of words
maxLength - the string will be truncated to this length, if longer
Returns:
a string of space-delimited, randomly choosen words where length() <= maxLength

words

public static String words(int min,
                           int max)
Returns a number of random, lowercase, space-delimited words between min and max.

Parameters:
min - the minimum number of words
max - the maximum nunmber of words
Returns:
a string of space-delimited, randomly choosen words

generate

public static String generate(String type,
                              int count)
Generates lorem ipsum text using an enumerated type.

Parameters:
type - "paragraph", "sentence", or "word"
count - the number of the type to generate
Returns:
lorem ipsum text

Last updated: Wed, Jan 7, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.