|
ritopt API Documentation by Damian Eads |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--gnu.dtools.ritopt.Utility
This class provides static utility members for some basic string operations.
Copyright (C) Damian Ryan Eads, 2001. All Rights Reserved. ritopt 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. ritopt 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 ritopt; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
| Constructor Summary | |
Utility()
|
|
| Method Summary | |
static boolean |
contains(char check,
java.lang.String list)
Returns true if any of the characters in the list are equal to the check character. |
static boolean |
contains(java.lang.String check,
java.lang.String list)
Returns true if any of the characters in the list appear in the check string passed. |
static int |
count(java.lang.String check,
char spec)
Returns the number of occurances the character specification appears in the check string passed. |
static java.lang.String |
expandString(java.lang.String s,
int length)
Returns a string with no more and no less than n characters where n is the length. |
static java.lang.String |
getSpaces(int count)
Returns a string containing the number of spaces passed as an argument. |
static boolean |
isAlpha(char check)
Returns true if the character is a letter in the phonetic alphabetic. |
static boolean |
isAlpha(java.lang.String check)
Returns true if the string only contains letters in the phonetic alphabet. |
static boolean |
isAlphaLower(char check)
Returns true if the character is a lower case letter in the phonetic alphabetic. |
static boolean |
isAlphaLower(java.lang.String check)
Returns true if the string only contains lower case letters in the phonetic alphabet. |
static boolean |
isAlphaNumeric(char check)
Returns true if the character is a letter in the phonetic alphabetic or is a decimal number. |
static boolean |
isAlphaUpper(char check)
Returns true if the character is a upper case letter in the phonetic alphabetic. |
static boolean |
isAlphaUpper(java.lang.String check)
Returns true if the string only contains upper case letters in the phonetic alphabet. |
static boolean |
isNumeric(char check)
Returns true if the character is a decimal number. |
static java.lang.String |
ltrim(java.lang.String s)
Trim spaces off the left side of this string. |
static java.lang.String |
repeat(char c,
int count)
Returns a string with a character repeated based on a count passed. |
static java.lang.String |
repeat(java.lang.String s,
int count)
Returns a string with the passed string repeated based on the integer count passed. |
static java.lang.String |
rtrim(java.lang.String s)
Trim spaces off the right side of this string. |
static java.lang.String |
stripComments(java.lang.String s,
char delim,
char comment)
Takes a line (presumably from a file) and removes a comment if one exists. |
static java.lang.String |
trim(java.lang.String s)
Trim spaces off both sides of this string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Utility()
| Method Detail |
public static boolean contains(java.lang.String check,
java.lang.String list)
check - The string to check.list - The list of valid characters.
public static int count(java.lang.String check,
char spec)
check - The string to check.spec - The character specification.
public static boolean contains(char check,
java.lang.String list)
check - The character to check.list - The list of valid characters.public static boolean isAlpha(java.lang.String check)
check - The string to check.public static boolean isAlphaLower(java.lang.String check)
check - The string to check.public static boolean isAlphaUpper(java.lang.String check)
check - The string to check.public static boolean isAlpha(char check)
check - The character to check.public static boolean isAlphaLower(char check)
check - The character to check.public static boolean isAlphaUpper(char check)
check - The character to check.public static boolean isAlphaNumeric(char check)
check - The character to check.public static boolean isNumeric(char check)
check - The character to check.
public static java.lang.String expandString(java.lang.String s,
int length)
s - The string to expand.length - The required length.public static java.lang.String getSpaces(int count)
count - The number of spaces in the string returned.
public static java.lang.String repeat(char c,
int count)
c - The character to repeat.count - The number of times to repeat the character.public static java.lang.String ltrim(java.lang.String s)
s - The string to trim.public static java.lang.String rtrim(java.lang.String s)
s - The string to trim.public static java.lang.String trim(java.lang.String s)
s - The string to trim.
public static java.lang.String stripComments(java.lang.String s,
char delim,
char comment)
s - The string to strip comments off.delim - The string delimiter.comment - The comment character.
public static java.lang.String repeat(java.lang.String s,
int count)
s - The string to repeat.count - The number of times to repeat the string.
|
Copyright (C) Damian Ryan Eads, 2001. All Rights Reserved. |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||