jvntextpro.util
Class StringUtils

java.lang.Object
  extended by jvntextpro.util.StringUtils

public class StringUtils
extends java.lang.Object

The Class StringUtils.


Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.String capitalizeWord(java.lang.String s)
          Capitalises the first letter of a given string.
static boolean containLetter(java.lang.String str)
          Contain letter.
static boolean containLetterAndDigit(java.lang.String str)
          Contain letter and digit.
static boolean containNumber(java.lang.String str)
          Contain number.
static int countOccurrences(java.lang.String s, char c)
          Counts the number of occurrences of a character in the specified String.
static int countSigns(java.lang.String str)
          Count signs.
static int countStops(java.lang.String str)
          Count stops.
static java.lang.String doubleQuote(java.lang.String s)
          Encloses the specified String in double quotes.
static boolean endsWithSign(java.lang.String str)
          Ends with sign.
static boolean endsWithStop(java.lang.String str)
          Ends with stop.
static int findFirstNotOf(java.lang.String container, java.lang.String chars, int begin)
          Find first not of.
static int findFirstOf(java.lang.String container, java.lang.String chars, int begin)
          Find first of.
static int findLastNotOf(java.lang.String container, java.lang.String charSeq, int end)
          Find last not of.
static int findLastOf(java.lang.String container, java.lang.String charSeq, int begin)
          Find last of.
static int indexOf(java.lang.String[] array, java.lang.String s)
          Returns the index of the first occurrence of the specified String in an array of Strings.
static boolean isAllCap(java.lang.String str)
          Checks if is all cap.
static boolean isAllNumber(java.lang.String str)
          Checks if is all number.
static boolean isBlank(java.lang.String s)
          Checks whether a String is whitespace, empty or null.
static boolean isContained(java.lang.String[] array, java.lang.String s)
          Indicates whether the specified array of Strings contains a given String.
static boolean isFirstCap(java.lang.String str)
          Checks if is first cap.
static boolean isFirstCap1(java.lang.String str)
          Checks if is first cap1.
static boolean isNotFirstCap(java.lang.String str)
          Checks if is not first cap.
static boolean isSign(java.lang.String str)
          Checks if is sign.
static boolean isStop(java.lang.String str)
          Checks if is stop.
static boolean isWhitespace(java.lang.String s)
          Checks whether a String is composed entirely of whitespace characters.
static java.lang.String join(java.util.Collection col, char sep)
          Join the String representations of a collection of objects, with the specified separator.
static java.lang.String join(java.lang.Object[] objects, char sep)
          Join the String representations of an array of objects, with the specified separator.
static java.lang.String pad(java.lang.String s, int length)
          Pad the specified String with spaces on the right-hand side.
static java.lang.String quote(java.lang.String s)
          Encloses the specified String in single quotes.
static java.lang.String sort(java.lang.String s)
          Sorts the characters in the specified string.
static java.util.ArrayList<java.lang.String> toList(java.util.Set<java.lang.String> set)
          Creates a new ArrayList collection from the specified Set of Strings.
static java.util.ArrayList<java.lang.String> toList(java.lang.String[] array)
          Creates a new ArrayList collection from the specified array of Strings.
static java.util.Vector<java.lang.String> toVector(java.lang.String[] array)
          Creates a new Vector collection from the specified array of Strings.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

findFirstOf

public static int findFirstOf(java.lang.String container,
                              java.lang.String chars,
                              int begin)
Find first of.

Parameters:
container - the container
chars - the chars
begin - the begin
Returns:
the int

findLastOf

public static int findLastOf(java.lang.String container,
                             java.lang.String charSeq,
                             int begin)
Find last of.

Parameters:
container - the container
charSeq - the char seq
begin - the begin
Returns:
the int

findFirstNotOf

public static int findFirstNotOf(java.lang.String container,
                                 java.lang.String chars,
                                 int begin)
Find first not of.

Parameters:
container - the container
chars - the chars
begin - the begin
Returns:
the int

findLastNotOf

public static int findLastNotOf(java.lang.String container,
                                java.lang.String charSeq,
                                int end)
Find last not of.

Parameters:
container - the container
charSeq - the char seq
end - the end
Returns:
the int

containNumber

public static boolean containNumber(java.lang.String str)
Contain number.

Parameters:
str - the str
Returns:
true, if successful

containLetter

public static boolean containLetter(java.lang.String str)
Contain letter.

Parameters:
str - the str
Returns:
true, if successful

containLetterAndDigit

public static boolean containLetterAndDigit(java.lang.String str)
Contain letter and digit.

Parameters:
str - the str
Returns:
true, if successful

isAllNumber

public static boolean isAllNumber(java.lang.String str)
Checks if is all number.

Parameters:
str - the str
Returns:
true, if is all number

isFirstCap

public static boolean isFirstCap(java.lang.String str)
Checks if is first cap.

Parameters:
str - the str
Returns:
true, if is first cap

isFirstCap1

public static boolean isFirstCap1(java.lang.String str)
Checks if is first cap1.

Parameters:
str - the str
Returns:
true, if is first cap1

isAllCap

public static boolean isAllCap(java.lang.String str)
Checks if is all cap.

Parameters:
str - the str
Returns:
true, if is all cap

isNotFirstCap

public static boolean isNotFirstCap(java.lang.String str)
Checks if is not first cap.

Parameters:
str - the str
Returns:
true, if is not first cap

endsWithSign

public static boolean endsWithSign(java.lang.String str)
Ends with sign.

Parameters:
str - the str
Returns:
true, if successful

endsWithStop

public static boolean endsWithStop(java.lang.String str)
Ends with stop.

Parameters:
str - the str
Returns:
true, if successful

countStops

public static int countStops(java.lang.String str)
Count stops.

Parameters:
str - the str
Returns:
the int

countSigns

public static int countSigns(java.lang.String str)
Count signs.

Parameters:
str - the str
Returns:
the int

isStop

public static boolean isStop(java.lang.String str)
Checks if is stop.

Parameters:
str - the str
Returns:
true, if is stop

isSign

public static boolean isSign(java.lang.String str)
Checks if is sign.

Parameters:
str - the str
Returns:
true, if is sign

join

public static java.lang.String join(java.lang.Object[] objects,
                                    char sep)
Join the String representations of an array of objects, with the specified separator.

Parameters:
objects - the objects
sep - the sep
Returns:
newly created .

join

public static java.lang.String join(java.util.Collection col,
                                    char sep)
Join the String representations of a collection of objects, with the specified separator.

Parameters:
col - the col
sep - the sep
Returns:
newly created .

capitalizeWord

public static java.lang.String capitalizeWord(java.lang.String s)
Capitalises the first letter of a given string.

Parameters:
s - the input string
Returns:
the capitalized string

quote

public static java.lang.String quote(java.lang.String s)
Encloses the specified String in single quotes.

Parameters:
s - the input string
Returns:
the quoted String

doubleQuote

public static java.lang.String doubleQuote(java.lang.String s)
Encloses the specified String in double quotes.

Parameters:
s - the input string
Returns:
the quoted String

pad

public static java.lang.String pad(java.lang.String s,
                                   int length)
Pad the specified String with spaces on the right-hand side.

Parameters:
s - String to add spaces
length - Desired length of string after padding
Returns:
padded string.

sort

public static java.lang.String sort(java.lang.String s)
Sorts the characters in the specified string.

Parameters:
s - input String to sort.
Returns:
output String, containing sorted characters.

isBlank

public static boolean isBlank(java.lang.String s)
Checks whether a String is whitespace, empty or null.

Parameters:
s - the String to analyze.
Returns:
otherwise.

isWhitespace

public static boolean isWhitespace(java.lang.String s)
Checks whether a String is composed entirely of whitespace characters.

Parameters:
s - the String to analyze.
Returns:
otherwise.

countOccurrences

public static int countOccurrences(java.lang.String s,
                                   char c)
Counts the number of occurrences of a character in the specified String.

Parameters:
s - the String to analyze.
c - the character to search for.
Returns:
number of occurrences found.

isContained

public static boolean isContained(java.lang.String[] array,
                                  java.lang.String s)
Indicates whether the specified array of Strings contains a given String.

Parameters:
array - the array
s - the s
Returns:
otherwise.

indexOf

public static int indexOf(java.lang.String[] array,
                          java.lang.String s)
Returns the index of the first occurrence of the specified String in an array of Strings.

Parameters:
array - array of Strings to search.
s - the String to search for.
Returns:
the index of the first occurrence of the argument in this list, or -1 if the string is not found.

toList

public static java.util.ArrayList<java.lang.String> toList(java.lang.String[] array)
Creates a new ArrayList collection from the specified array of Strings.

Parameters:
array - the array
Returns:
newly created .

toVector

public static java.util.Vector<java.lang.String> toVector(java.lang.String[] array)
Creates a new Vector collection from the specified array of Strings.

Parameters:
array - the array
Returns:
newly created .

toList

public static java.util.ArrayList<java.lang.String> toList(java.util.Set<java.lang.String> set)
Creates a new ArrayList collection from the specified Set of Strings.

Parameters:
set - a set of Strings.
Returns:
newly created .