|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.ObjectjAudioFeatureExtractor.GeneralTools.StringMethods
public class StringMethods
A holder class for static methods relating to manipulating strings.
String
コンストラクタの概要 | |
---|---|
StringMethods()
|
メソッドの概要 | |
---|---|
static java.lang.String |
convertFilePathToFileName(java.lang.String file_path)
Returns the name of the file referred to by the given path. |
static java.lang.String |
getBeginningOfString(java.lang.String string_to_shorten,
int number_characters)
Returns a copy of the given string with all but the first number_characters eliminated. |
static java.lang.String |
getBeginningOfStringWithHyphenFiller(java.lang.String string_to_shorten,
int number_characters)
Returns a copy of the given string with all but the first number_characters eliminated. |
static java.lang.String |
getDirectoryName(java.lang.String file_path)
Returns the name of the directory that the given filename is found in. |
static java.lang.String |
getDoubleInScientificNotation(double number_to_round,
int significant_digits)
Returns a formatted version of number_to_round that has been converted to scientific notation and includes the given number of significant_digits. |
static java.lang.String |
getExtension(java.lang.String filename)
Returns the 2, 3 or 4 letter extension of the given file name. |
static int |
getIndexOfString(java.lang.String given_name,
java.lang.String[] possible_names)
Returns the index in the possible_names array where the given_name parameter occurs. |
static java.lang.String |
getRoundedDouble(double number_to_round,
int decimal_places)
Returns a formatted version of number_to_round. |
static java.lang.String[] |
removeDoubles(java.lang.String[] strings)
Returns a shorened copy of the given array of strings with all duplicate entries removed. |
static java.lang.String |
removeExtension(java.lang.String filename)
Returns a copy of the given string with the extension removed. |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public StringMethods()
メソッドの詳細 |
---|
public static java.lang.String convertFilePathToFileName(java.lang.String file_path)
file_path
- The file path from which the file name is to be extracted.
public static java.lang.String getDirectoryName(java.lang.String file_path) throws java.lang.Exception
java.lang.Exception
public static java.lang.String removeExtension(java.lang.String filename)
IMPORTANT: filename should consist of at least four characters.
filename
- The name of the file from which the extension is to be removed.
public static java.lang.String getExtension(java.lang.String filename)
IMPORTANT: filename should consist of at least four characters.
filename
- The name of the file from which the extension is to be returned.
public static java.lang.String getBeginningOfString(java.lang.String string_to_shorten, int number_characters)
string_to_shorten
- The string to be shortened or have spaces added to its end.number_characters
- Number of characters in the new string.
public static java.lang.String getBeginningOfStringWithHyphenFiller(java.lang.String string_to_shorten, int number_characters)
string_to_shorten
- The string to be shortened or have spaces added to its end.number_characters
- Number of characters in the new string.
public static java.lang.String getDoubleInScientificNotation(double number_to_round, int significant_digits)
Values of not a number, negative infinity and positive infinity will be returned as NaN, -Infinity and Infinity respectively.
number_to_round
- The number that is to be formatted.significant_digits
- The number of significant digits to use.public static java.lang.String getRoundedDouble(double number_to_round, int decimal_places)
Values of not a number, negative infinity and positive infinity will be returned as NaN, -Infinity and Infinity respectively.
number_to_round
- The number that is to be rounded.decimal_places
- The maximum number of decimal places that will be displayed.public static int getIndexOfString(java.lang.String given_name, java.lang.String[] possible_names) throws java.lang.Exception
given_name
- The string to search for in possible_names.possible_names
- The array to search for given_names in.
java.lang.Exception
public static java.lang.String[] removeDoubles(java.lang.String[] strings)
strings
- The array of strings to remove duplicate entries from.
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |