org.exoplatform.forum.extras.injection.utils
Class LoremIpsum4J

java.lang.Object
  extended by org.exoplatform.forum.extras.injection.utils.LoremIpsum4J

public class LoremIpsum4J
extends Object

Simple lorem ipsum text generator.

Suitable for creating sample data for test cases and performance tests.

Version:
1.0
Author:
Sven Jacobs

Field Summary
static String LOREM_IPSUM
           
 
Constructor Summary
LoremIpsum4J()
           
 
Method Summary
 String getCharacters(int amount)
          Returns characters from the lorem ipsum text.
 String getCharacters(int amount, int startIndex)
          Returns words from the lorem ipsum text.
 String getParagraphs()
          Returns two paragraphs of lorem ipsum.
 String getParagraphs(int amount)
          Returns paragraphs of lorem ipsum.
 String getWords()
          Returns one sentence (50 words) of the lorem ipsum text.
 String getWords(int amount)
          Returns words from the lorem ipsum text.
 String getWords(int amount, int startIndex)
          Returns words from the lorem ipsum text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOREM_IPSUM

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

LoremIpsum4J

public LoremIpsum4J()
Method Detail

getWords

public String getWords()
Returns one sentence (50 words) of the lorem ipsum text.

Returns:
50 words of lorem ipsum text

getWords

public String getWords(int amount)
Returns words from the lorem ipsum text.

Parameters:
amount - Amount of words
Returns:
Lorem ipsum text

getCharacters

public String getCharacters(int amount)
Returns characters from the lorem ipsum text.

Parameters:
amount - Amount of characters
Returns:
Lorem ipsum text

getWords

public String getWords(int amount,
                       int startIndex)
Returns words from the lorem ipsum text.

Parameters:
amount - Amount of words
startIndex - Start index of word to begin with (must be >= 0 and < 50)
Returns:
Lorem ipsum text
Throws:
IndexOutOfBoundsException - If startIndex is < 0 or > 49

getCharacters

public String getCharacters(int amount,
                            int startIndex)
Returns words from the lorem ipsum text.

Parameters:
amount - Amount of words
startIndex - Start index of word to begin with (must be >= 0 and < 50)
Returns:
Lorem ipsum text
Throws:
IndexOutOfBoundsException - If startIndex is < 0 or > 49

getParagraphs

public String getParagraphs()
Returns two paragraphs of lorem ipsum.

Returns:
Lorem ipsum paragraphs

getParagraphs

public String getParagraphs(int amount)
Returns paragraphs of lorem ipsum.

Parameters:
amount - Amount of paragraphs
Returns:
Lorem ipsum paragraphs


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.