public class DefaultComboBoxConfigurableLookUpModel.VectorUtilities extends Object
New functionality to work with vectors (of elements).
This class is a copy of a class with the same name located in libIverUtiles.
Constructor and Description |
---|
DefaultComboBoxConfigurableLookUpModel.VectorUtilities()
Creates a new instance of the class
VectorUtilities . |
Modifier and Type | Method and Description |
---|---|
void |
addAlphabeticallyOrdered(Vector<Object> v,
Object obj)
Adds an item in alphabetical order.
|
void |
addAlphabeticallyOrdered(Vector<Object> v,
Object obj,
Comparator<Object> comp)
Adds an item in alphabetic order using a comparator for compare the objects.
|
double |
log2(double a)
2-base logarithm of a
|
int |
log2Integer(double a)
2-base logarithm of a, but the result doesn't have decimals (approximated to the integer number most near by below)
|
public DefaultComboBoxConfigurableLookUpModel.VectorUtilities()
Creates a new instance of the class VectorUtilities
.
public void addAlphabeticallyOrdered(Vector<Object> v, Object obj)
Adds an item in alphabetical order.
v
- java.util.Vector in alphabetical order.obj
- java.lang.Objectpublic void addAlphabeticallyOrdered(Vector<Object> v, Object obj, Comparator<Object> comp)
Adds an item in alphabetic order using a comparator for compare the objects. The objects must be alhabetically ordered.
v
- java.util.Vector in alphabetical order.obj
- java.lang.Objectcomp
- java.util.Comparatorpublic double log2(double a)
2-base logarithm of a
a
- The value to do the calculationspublic int log2Integer(double a)
2-base logarithm of a, but the result doesn't have decimals (approximated to the integer number most near by below)
a
- The value to do the calculations