public class Utils
extends java.lang.Object
Assorted methods to manage several topics
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static float |
Assigned(float val,
float tope)
Rounds the generated value for the semantics when necesary
|
static boolean |
BETTER(double X,
double Y)
Returns if the first double argument is better than the second
|
static boolean |
BETTER(float X,
float Y)
Returns if the first float argument is better than the second
|
static boolean |
BETTER(int X,
int Y)
Returns if the first integer argument is better than the second
|
static java.lang.String |
getFileName(java.util.StringTokenizer s)
Gets the name for the file, eliminating "" and skiping "="
|
static float |
getParamFloat(java.util.StringTokenizer s)
Gets an float from param file, skiping "="
|
static int |
getParamInt(java.util.StringTokenizer s)
Gets an integer from param file, skiping "="
|
static java.lang.String |
getParamString(java.util.StringTokenizer s)
Gets an String from param file, skiping "="
|
static int |
getposString(java.util.Vector vect_valores,
java.lang.String valor)
Returns the position of the element at the vector, -1 if does not appear
|
static float |
Maximum(float x,
float y)
Returns the maximum of two float values
|
static float |
Minimum(float x,
float y)
Returns the minimum of two float values
|
static void |
OrCrecIndex(double[] v,
int left,
int right,
int[] index)
C.A.R, Hoare Quick sort.
|
static void |
OrDecIndex(double[] v,
int left,
int right,
int[] index)
C.A.R, Hoare Quick sort.
|
public static int getParamInt(java.util.StringTokenizer s)
Gets an integer from param file, skiping "="
s
- Tokenpublic static float getParamFloat(java.util.StringTokenizer s)
Gets an float from param file, skiping "="
s
- Tokenpublic static java.lang.String getParamString(java.util.StringTokenizer s)
Gets an String from param file, skiping "="
s
- Tokenpublic static java.lang.String getFileName(java.util.StringTokenizer s)
Gets the name for the file, eliminating "" and skiping "="
s
- Tokenpublic static int getposString(java.util.Vector vect_valores, java.lang.String valor)
Returns the position of the element at the vector, -1 if does not appear
vect_valores
- Vector of valuesvalor
- Value to seekpublic static float Minimum(float x, float y)
Returns the minimum of two float values
x
- A floaty
- A floatpublic static float Maximum(float x, float y)
Returns the maximum of two float values
x
- A floaty
- A floatpublic static boolean BETTER(float X, float Y)
Returns if the first float argument is better than the second
X
- Some floatY
- Some floatpublic static boolean BETTER(int X, int Y)
Returns if the first integer argument is better than the second
X
- Some integerY
- Some integerpublic static boolean BETTER(double X, double Y)
Returns if the first double argument is better than the second
X
- Some doubleY
- Some doublepublic static void OrDecIndex(double[] v, int left, int right, int[] index)
C.A.R, Hoare Quick sort. Based on sort by interchange. Decreasing sort.
v
- Vector to be sortedleft
- Position to sortright
- Final position to sortindex
- The indexes of the original vectorpublic static void OrCrecIndex(double[] v, int left, int right, int[] index)
C.A.R, Hoare Quick sort. Based on sort by interchange. Incresing sort.
v
- Vector to be sortedleft
- Initial position to sortright
- Final position to sortindex
- The indexes of the original vectorpublic static float Assigned(float val, float tope)
Rounds the generated value for the semantics when necesary
val
- The value to roundtope
- Threshold