com.pushtotest.tool.util
Class Lingo

java.lang.Object
  extended by com.pushtotest.tool.util.Lingo

public class Lingo
extends java.lang.Object

Lingo creates dummy text for message body and message subject. The 2 methods that do the real work are the getMessage and getSubject that take the 4 arguments, the rest of the methods just pass in some default values for that stuff. It creates strings of pseudo-randomly selected words.


Constructor Summary
Lingo()
          Default constructor.
Lingo(java.lang.String encoding)
          Creates a Lingo object that will use a specific encoder.
Lingo(java.lang.String[] inCaps, java.lang.String[] inTokens)
          Creates a Lingo object allowing the user to set the Capital words and the lowercase tokens that they would like to use to generate the Lingo.
Lingo(java.lang.String[] inCaps, java.lang.String[] inTokens, java.lang.String encoding)
          Creates a Lingo object allowing the user to set the Capital words and the lowercase tokens that they would like to use to generate the Lingo.
 
Method Summary
 java.lang.String getMessage()
          Creates a Lingo Message with a default size of about 35 words.
 java.lang.String getMessage(int length)
          Creates a Lingo Message of the length specified This method uses capital letters, periods, etc.
 java.lang.String getMessage(int size, boolean startCap, boolean endPeriod, boolean encoded)
          Assemble the new message body.
 java.lang.String getMessageEncoded()
          Creates a Lingo message with a default size of 35 words.
 java.lang.String getMessageEncoded(int length)
          Creates a Lingo Message of the length specified This method uses capital letters, periods, etc.
 java.lang.String getSingle()
          Return just a single Lingo word
 java.lang.String getSingleCap()
          Return just a single capitalized Lingo word
 java.lang.String getString(int size)
          Return a String containing the define number of random characters.
 java.lang.String getSubject()
          Assemble the new subject line Uses a default of about 3 words
 java.lang.String getSubject(int length)
          Assemble the new subject line Uses a default of about 3 words
 java.lang.String getSubject(int size, boolean startCap, boolean endPeriod, boolean encoded)
          Builds a Lingo String suitable for the subject of a message It won't have line breaks or anything in it
 java.lang.String getSubjectEncoded()
          Assemble the new subject line Uses a default of about 3 words
 java.lang.String getSubjectEncoded(int length)
          Assemble the new subject line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lingo

public Lingo()
Default constructor. Uses the default list of fake English-like words.


Lingo

public Lingo(java.lang.String encoding)
Creates a Lingo object that will use a specific encoder. For example, Lingo("UTF-8") creates a Lingo object that uses the Unicode encoder. Details on UTF-8 are at: http://www.cl.cam.ac.uk/~mgk25/unicode.html#examples additional info on encoding is at: http://czyborra.com/utf/

Parameters:
encoding - The encoding to use.

Lingo

public Lingo(java.lang.String[] inCaps,
             java.lang.String[] inTokens)
Creates a Lingo object allowing the user to set the Capital words and the lowercase tokens that they would like to use to generate the Lingo.

Parameters:
inCaps - The capital words used for starting sentences.
inTokens - The lowercase words used for everything else

Lingo

public Lingo(java.lang.String[] inCaps,
             java.lang.String[] inTokens,
             java.lang.String encoding)
Creates a Lingo object allowing the user to set the Capital words and the lowercase tokens that they would like to use to generate the Lingo.

Parameters:
inCaps - The capital words used for starting sentences.
inTokens - The lowercase words used for everything else
encoding - The encoding style
Method Detail

getMessage

public java.lang.String getMessage()
Creates a Lingo Message with a default size of about 35 words. This method uses capital letters, periods, etc.

Returns:
The Lingo Message

getMessage

public java.lang.String getMessage(int length)
Creates a Lingo Message of the length specified This method uses capital letters, periods, etc.

Parameters:
length - The length that you want the message
Returns:
The Lingo Message

getMessageEncoded

public java.lang.String getMessageEncoded()
Creates a Lingo message with a default size of 35 words. This method uses capital letters, periods, etc.

Returns:
A URLEncoded version of the Lingo string

getMessageEncoded

public java.lang.String getMessageEncoded(int length)
Creates a Lingo Message of the length specified This method uses capital letters, periods, etc.

Parameters:
length - The length that you want the message
Returns:
The Lingo Message

getSubject

public java.lang.String getSubject()
Assemble the new subject line Uses a default of about 3 words

Returns:
The Lingo String

getSubject

public java.lang.String getSubject(int length)
Assemble the new subject line Uses a default of about 3 words

Parameters:
length - The length that you want the message
Returns:
The Lingo String

getSubjectEncoded

public java.lang.String getSubjectEncoded()
Assemble the new subject line Uses a default of about 3 words

Returns:
The URLEncoded version of the Lingo string

getSubjectEncoded

public java.lang.String getSubjectEncoded(int length)
Assemble the new subject line

Parameters:
length - The length that you want the message
Returns:
The URLEncoded version of the Lingo string

getMessage

public java.lang.String getMessage(int size,
                                   boolean startCap,
                                   boolean endPeriod,
                                   boolean encoded)
Assemble the new message body. This method uses capital letters, periods, newlines etc.

Parameters:
size - The length you want the message to be
startCap - Start with a capital letter?
endPeriod - End with a period?
encoded - URL Encoded?
Returns:
The Lingo string for a body

getSubject

public java.lang.String getSubject(int size,
                                   boolean startCap,
                                   boolean endPeriod,
                                   boolean encoded)
Builds a Lingo String suitable for the subject of a message It won't have line breaks or anything in it

Parameters:
size - The length you want the message to be
startCap - Start with a capital letter?
endPeriod - End with a period?
encoded - URL Encoded?
Returns:
The Subject string

getSingle

public java.lang.String getSingle()
Return just a single Lingo word

Returns:
A single pseudo random word.

getSingleCap

public java.lang.String getSingleCap()
Return just a single capitalized Lingo word

Returns:
A single pseudo random word.

getString

public java.lang.String getString(int size)
Return a String containing the define number of random characters. This method is synchronized.