Package org.nd4j.common.tools
Class BTools
- java.lang.Object
-
- org.nd4j.common.tools.BTools
-
public class BTools extends Object
-
-
Constructor Summary
Constructors Constructor Description BTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetIndexCharsCount(int MaxIndex)getIndexCharsCount
public static int getIndexCharsCount( int MaxIndex )
Returns chars count for max value of index.
Example: Max value of index is 150 and chars count is 3.
It is important for statement of indexed values.
Index columns can have the same width for all rouws.static StringgetMtLvESS(int mtLv)getMtLvESS
public static String getMtLvESS( int mtLv )
Returns string.static StringgetMtLvISS()getMtLvISS
public static String getMtLvISS()
Returns string.static StringgetSBln(boolean... blnA)getSBln
public static String getSBln( boolean...static StringgetSDbl(double Value, int DecPrec)getSDbl
public static String getSDbl( double Value, int DecPrec )
Returns double converted to string.
If Value is Double.NaN returns "NaN".
If DecPrec is < 0 is DecPrec set 0.static StringgetSDbl(double Value, int DecPrec, boolean ShowPlusSign)getSDbl
public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign )
Returns double converted to string.
If Value is Double.NaN returns "NaN".
If DecPrec is < 0 is DecPrec set 0.
If ShowPlusSign is true:
- If Value is > 0 sign is '+'.
- If Value is 0 sign is ' '.static StringgetSDbl(double Value, int DecPrec, boolean ShowPlusSign, int StringLength)getSDbl
public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign, int StringLength )
Returns double converted to string.
If Value is Double.NaN returns "NaN".
If DecPrec is < 0 is DecPrec set 0.
If ShowPlusSign is true:
- If Value is > 0 sign is '+'.
- If Value is 0 sign is ' '.
If StringLength is > base double string length
before base double string adds relevant spaces.
If StringLength is <= base double string length
returns base double string.static StringgetSInt(int Value)getSInt
public static String getSInt( int Value )
Returns int converted to string.static StringgetSInt(int Value, int CharsCount)getSInt
public static String getSInt( int Value, int CharsCount )
Returns int converted to string.
If CharsCount > base int string length
before base int string adds relevant spaces.
If CharsCount <= base int string length
returns base int string.static StringgetSInt(int Value, int CharsCount, char LeadingChar)getSInt
public static String getSInt( int Value, int CharsCount, char LeadingChar )
Returns int converted to string.
If CharsCount > base int string length
before base int string adds relevant leading chars.
If CharsCount <= base int string length
returns base int string.static StringgetSIntA(int... intA)getSIntA
public static String getSIntA( int...static StringgetSLcDtTm()getSLcDtTm
public static String getSLcDtTm()
Returns local datetime as string.
Datetime format is "mm:ss.SSS".static StringgetSLcDtTm(String FormatS)getSLcDtTm
public static String getSLcDtTm( String FormatS )
Returns local datetime as string.
Datetime format is param.static StringgetSpaces(int SpacesCount)getSpaces
public static String getSpaces( int SpacesCount )
Returns asked count of spaces.
If count of spaces is < 0 returns '?'.
-
-
-
Method Detail
-
getMtLvESS
public static String getMtLvESS(int mtLv)
getMtLvESS
public static String getMtLvESS( int mtLv )
Returns string. String length create indentation(shift) of other text.
Indentation depends on method level - great method level, great indentation.
Main method has method level 0.
Other called method has method level 1, 2,...N.- Parameters:
mtLv- - method level- Returns:
- method level external shift string
-
getMtLvISS
public static String getMtLvISS()
getMtLvISS
public static String getMtLvISS()
Returns string. String create indentation(shift)
internal text to start text of method.- Returns:
- method level internal shift string
-
getSpaces
public static String getSpaces(int SpacesCount)
getSpaces
public static String getSpaces( int SpacesCount )
Returns asked count of spaces.
If count of spaces is < 0 returns '?'.- Parameters:
SpacesCount- = spaces count- Returns:
- spaces
-
getSBln
public static String getSBln(boolean... blnA)
getSBln
public static String getSBln( boolean... blnA )
Returns boolean(s) converted to char (true = 'T'; false = 'F')
If blnA.length is > 1 returns chars without separator.
If blnA is '{ true, false, true }' returns 'TFT'.
If blnA is null returns '?'.
If blnA.length is 0 returns '?'.- Parameters:
blnA-- Returns:
- boolean(s) as string
-
getSDbl
public static String getSDbl(double Value, int DecPrec)
getSDbl
public static String getSDbl( double Value, int DecPrec )
Returns double converted to string.
If Value is Double.NaN returns "NaN".
If DecPrec is < 0 is DecPrec set 0.- Parameters:
Value- - valueDecPrec- - decimal precision- Returns:
- double as string
-
getSDbl
public static String getSDbl(double Value, int DecPrec, boolean ShowPlusSign)
getSDbl
public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign )
Returns double converted to string.
If Value is Double.NaN returns "NaN".
If DecPrec is < 0 is DecPrec set 0.
If ShowPlusSign is true:
- If Value is > 0 sign is '+'.
- If Value is 0 sign is ' '.- Parameters:
Value- - valueDecPrec- - decimal precisionShowPlusSign- - show plus sign- Returns:
- double as string
-
getSDbl
public static String getSDbl(double Value, int DecPrec, boolean ShowPlusSign, int StringLength)
getSDbl
public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign, int StringLength )
Returns double converted to string.
If Value is Double.NaN returns "NaN".
If DecPrec is < 0 is DecPrec set 0.
If ShowPlusSign is true:
- If Value is > 0 sign is '+'.
- If Value is 0 sign is ' '.
If StringLength is > base double string length
before base double string adds relevant spaces.
If StringLength is <= base double string length
returns base double string.- Parameters:
Value- - valueDecPrec- - decimal precisionShowPlusSign- - show plus signStringLength- - string length- Returns:
- double as string
-
getSInt
public static String getSInt(int Value, int CharsCount)
getSInt
public static String getSInt( int Value, int CharsCount )
Returns int converted to string.
If CharsCount > base int string length
before base int string adds relevant spaces.
If CharsCount <= base int string length
returns base int string.- Parameters:
Value- - valueCharsCount- - chars count- Returns:
- int as string
-
getSInt
public static String getSInt(int Value, int CharsCount, char LeadingChar)
getSInt
public static String getSInt( int Value, int CharsCount, char LeadingChar )
Returns int converted to string.
If CharsCount > base int string length
before base int string adds relevant leading chars.
If CharsCount <= base int string length
returns base int string.- Parameters:
Value- - valueCharsCount- - chars countLeadingChar- - leading char- Returns:
- int as string
-
getSInt
public static String getSInt(int Value)
getSInt
public static String getSInt( int Value )
Returns int converted to string.- Parameters:
Value-- Returns:
- int as string
-
getSIntA
public static String getSIntA(int... intA)
getSIntA
public static String getSIntA( int... intA )
Returns intA converted to string.
Strings are separated with ", ".
If intA is null returns '?'.
If intA.length is 0 returns '?'.- Parameters:
intA- - int value(s) (one or more)- Returns:
- int... as string
-
getIndexCharsCount
public static int getIndexCharsCount(int MaxIndex)
getIndexCharsCount
public static int getIndexCharsCount( int MaxIndex )
Returns chars count for max value of index.
Example: Max value of index is 150 and chars count is 3.
It is important for statement of indexed values.
Index columns can have the same width for all rouws.- Parameters:
MaxIndex- - max value of index- Returns:
- chars count for max value of index
-
getSLcDtTm
public static String getSLcDtTm()
getSLcDtTm
public static String getSLcDtTm()
Returns local datetime as string.
Datetime format is "mm:ss.SSS".- Returns:
- local datetime as string
-
-