$darkmode
DENOPTIM
denoptim.utils.GeneralUtils Class Reference

General utilities. More...

Static Public Member Functions

static String getPaddedString (int count, int number)
 returns the padded string with zeroes placed to the left of 'number' up to reach the desired number of digits. More...
 
static void printMemoryDetails ()
 Print an analysis of the current memory usage. More...
 
static int getIdxOfClosing (int id, String s)
 Return the index of the closing parenthesis. More...
 
static< T > void unionOfIntersectingSets (List< Set< T > > list)
 Takes the union of any two sets in this list that intersect. More...
 
static String getEnglishFormattedDecimal (String pattern, int decimals, double value)
 Formats a decimal number using the given pattern but with English format as for separators. More...
 
static String getEnglishFormattedDecimal (String pattern, double value)
 Formats a decimal number using the given pattern but with English format as for separators. More...
 

Static Private Attributes

static Runtime RUNTIME = Runtime.getRuntime()
 
static final String NL = DENOPTIMConstants.EOL
 

Detailed Description

General utilities.

Definition at line 37 of file GeneralUtils.java.

Member Function Documentation

◆ getEnglishFormattedDecimal() [1/2]

static String denoptim.utils.GeneralUtils.getEnglishFormattedDecimal ( String  pattern,
double  value 
)
static

Formats a decimal number using the given pattern but with English format as for separators.

Imposes 4 as the minimum number of fractional digits.

Parameters
patternthe pattern to use. Example "###.####"
valuethe value to format
Returns
the formatted string

Definition at line 209 of file GeneralUtils.java.

References denoptim.utils.GeneralUtils.getEnglishFormattedDecimal().

Here is the call graph for this function:

◆ getEnglishFormattedDecimal() [2/2]

static String denoptim.utils.GeneralUtils.getEnglishFormattedDecimal ( String  pattern,
int  decimals,
double  value 
)
static

Formats a decimal number using the given pattern but with English format as for separators.

Parameters
patternthe pattern to use. Example "###.#"
decimalsminimum number of decimal digits to print. Overwrites the specific defined by the pattern.
valuethe value to format
Returns
the formatted string

Definition at line 190 of file GeneralUtils.java.

Referenced by denoptim.utils.FormulaUtilsTest.convertSimpleToString(), denoptim.utils.FormulaUtilsTest.convertToString(), denoptim.gui.CuttingRulesSelectionDialog.CuttingRulesSelectionDialog(), denoptim.utils.GeneralUtils.getEnglishFormattedDecimal(), and denoptim.graph.AttachmentPoint.getSingleAPStringSDF().

Here is the caller graph for this function:

◆ getIdxOfClosing()

static int denoptim.utils.GeneralUtils.getIdxOfClosing ( int  id,
String  s 
)
static

Return the index of the closing parenthesis.

Ignores nested parenthesis

Parameters
ididentified of the parenthesis (use 1 for round, 2 for square, and three for curly brackets)
sthe string to analyze
Returns
the index of the closing parenthesis

Definition at line 96 of file GeneralUtils.java.

◆ getPaddedString()

static String denoptim.utils.GeneralUtils.getPaddedString ( int  count,
int  number 
)
static

◆ printMemoryDetails()

static void denoptim.utils.GeneralUtils.printMemoryDetails ( )
static

Print an analysis of the current memory usage.

Definition at line 61 of file GeneralUtils.java.

References denoptim.utils.GeneralUtils.NL, and denoptim.utils.GeneralUtils.RUNTIME.

◆ unionOfIntersectingSets()

static< T > void denoptim.utils.GeneralUtils.unionOfIntersectingSets ( List< Set< T > >  list)
static

Takes the union of any two sets in this list that intersect.

Performs operations in-place.

Parameters
listList to merge sets of

Definition at line 149 of file GeneralUtils.java.

Referenced by denoptim.graph.DGraph.extractPattern(), and denoptim.utils.GenUtilsTest.testUnionOfSets().

Here is the caller graph for this function:

Member Data Documentation

◆ NL

final String denoptim.utils.GeneralUtils.NL = DENOPTIMConstants.EOL
staticprivate

Definition at line 40 of file GeneralUtils.java.

Referenced by denoptim.utils.GeneralUtils.printMemoryDetails().

◆ RUNTIME

Runtime denoptim.utils.GeneralUtils.RUNTIME = Runtime.getRuntime()
staticprivate

Definition at line 39 of file GeneralUtils.java.

Referenced by denoptim.utils.GeneralUtils.printMemoryDetails().


The documentation for this class was generated from the following file: