Project Wonder 5.0

er.extensions.components
Class ERXLoremIpsumGenerator

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

public class ERXLoremIpsumGenerator
extends java.lang.Object

Provides a generator for Lorem Ipsum text.

Author:
Brooks Hollar

Field Summary
static java.lang.String PARAGRAPH
           
static java.lang.String SENTENCE
           
static java.lang.String WORD
           
 
Constructor Summary
ERXLoremIpsumGenerator()
           
 
Method Summary
static java.lang.String all()
          Returns the entire Lorem text.
static java.lang.String firstParagraph()
          Returns the first paragram from Lorem Ipsum text.
static java.lang.String firstSentence()
          Returns the first sentence of the first paragraph from Lorem text.
static java.lang.String generate(java.lang.String type, int count)
          Generates lorem ipsum text using an enumerated type.
static java.lang.String[] list(int size)
          Returns a list of single sentences from the Lorem text.
static java.lang.String[] list(int size, int numberOfSentences)
          Returns a list of a given number of sentences from the Lorem text.
static java.lang.String paragraph()
          Returns a random paragraph of Lorem text.
static java.lang.String paragraph(int number)
          Returns a particular paragraph from Lorem text.
static java.lang.String paragraphs(int numParagraphs)
          Returns any number of random paragraphs of Lorem text.
static java.lang.String randomSentence()
          Returns a random sentence from the Lorem text.
static java.lang.String sentences(int numberSentences)
          Returns a given number of random sentences from the Lorem text.
static java.lang.String word()
          Returns a single, randomly choosen, lowercase word from Lorem text.
static java.lang.String words(int numWords)
          Returns a specific number of random, lowercase, space-delimited words from Lorem text.
static java.lang.String words(int min, int max)
          Returns a number of random, lowercase, space-delimited words between min and max.
static java.lang.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 java.lang.String PARAGRAPH
See Also:
Constant Field Values

SENTENCE

public static final java.lang.String SENTENCE
See Also:
Constant Field Values

WORD

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

ERXLoremIpsumGenerator

public ERXLoremIpsumGenerator()
Method Detail

all

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

Returns:
a string of all ten paragraphs of Lorem

firstParagraph

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

Returns:
a string of the first paragraph of Lorem

firstSentence

public static java.lang.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 java.lang.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 java.lang.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 java.lang.String paragraph()
Returns a random paragraph of Lorem text.

Returns:
a string of one random paragraph of Lorem

paragraph

public static java.lang.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 java.lang.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 java.lang.String randomSentence()
Returns a random sentence from the Lorem text.

Returns:
a string of a random sentence

sentences

public static java.lang.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 java.lang.String word()
Returns a single, randomly choosen, lowercase word from Lorem text.

Returns:
a string of a single, random word

words

public static java.lang.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 java.lang.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 java.lang.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 java.lang.String generate(java.lang.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: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.