com.softabar.lipsum
Class LoremIpsum4J

java.lang.Object
  extended by com.softabar.lipsum.LoremIpsum4J

public class LoremIpsum4J
extends java.lang.Object

LoremIpsum generater Lorem Ipsum paragraphs and words. This class uses lorem ipsum web service in www.lipsum.com.

  Copyright (C) 2006 Softabar
  
  This program is free software; you can redistribute it and/or modify it 
  under the terms of the GNU General Public License as published by the 
  Free Software Foundation; either version 2 of the License, or 
  (at your option) any later version.
  
  This program is distributed in the hope that it will be useful, but 
  WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License 
  along with this program; if not, write to the 
  Free Software Foundation, * Inc., * 59 Temple Place, * Suite 330, 
  Boston, MA 02111-1307 USA
 

Version:
1.1

Field Summary
static java.lang.String version
           
 
Constructor Summary
LoremIpsum4J()
           
 
Method Summary
 java.lang.String[] getBytes(int numberOfBytes)
          Get Lorem Ipsum bytes.
 int getGeneratedBytes()
          Return number of bytes generated in the last call to getParagraphs(), getBytes() or getWords() method.
 int getGeneratedParagraphs()
          Return number of paragraphs generated in the last call to getParagraphs(), getBytes() or getWords() method.
 int getGeneratedWords()
          Return number of words generated in the last call to getParagraphs(), getBytes() or getWords() method.
 java.lang.String[] getParagraphs(int numberOfParagraphs)
          Get Lorem Ipsum paragraphs.
 java.lang.String[] getWords(int numberOfWords)
          Get Lorem Ipsum words.
 boolean isCached()
          Return cache status.
 boolean isStartWithLoremIpsum()
          Return current setting of start with "lorem ipsum" option.
static void main(java.lang.String[] args)
           
 void setCached(boolean cached)
          Enable/disable cache.
 void setStartWithLoremIpsum(boolean startWithLoremIpsum)
          Set option to start with classic "Lorem ipsum".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

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

LoremIpsum4J

public LoremIpsum4J()
Method Detail

getParagraphs

public java.lang.String[] getParagraphs(int numberOfParagraphs)
Get Lorem Ipsum paragraphs.

Parameters:
numberOfParagraphs - Number of lorem ipsum paragraphs.
Returns:
Array of lorem ipsum paragraphs.

getWords

public java.lang.String[] getWords(int numberOfWords)
Get Lorem Ipsum words.

Parameters:
numberOfWords - Number of lorem ipsum words.
Returns:
Array of lorem ipsum paragraphs. Total word count equals parameter numberOfParagraphs.

getBytes

public java.lang.String[] getBytes(int numberOfBytes)
Get Lorem Ipsum bytes.

Parameters:
numberOfBytes - Number of lorem ipsum bytes.
Returns:
Array of lorem ipsum paragraphs that contain lorem ipsum words.

isStartWithLoremIpsum

public boolean isStartWithLoremIpsum()
Return current setting of start with "lorem ipsum" option.

Returns:
Current setting of "lorem ipsum" option.

setStartWithLoremIpsum

public void setStartWithLoremIpsum(boolean startWithLoremIpsum)
Set option to start with classic "Lorem ipsum". Default is true.

Parameters:
startWithLoremIpsum - Set start with "lorem ipsum".

main

public static void main(java.lang.String[] args)

getGeneratedBytes

public int getGeneratedBytes()
Return number of bytes generated in the last call to getParagraphs(), getBytes() or getWords() method.

Returns:
Number of generated bytes.

getGeneratedParagraphs

public int getGeneratedParagraphs()
Return number of paragraphs generated in the last call to getParagraphs(), getBytes() or getWords() method.

Returns:
Number of generated paragraphs.

getGeneratedWords

public int getGeneratedWords()
Return number of words generated in the last call to getParagraphs(), getBytes() or getWords() method.

Returns:
Number of generated words.

isCached

public boolean isCached()
Return cache status.

Returns:
True if cache is enabled.

setCached

public void setCached(boolean cached)
Enable/disable cache. Lorem Ipsum paragraphs are cached based on request lorem ipsum (words, paragraphs, bytes) and number of requested lorem ipsum.

Parameters:
cached - Set cache status.