public final class ObjectUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PathSeparator |
Constructor and Description |
---|
ObjectUtility() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Vector<T> |
convertFromListToVector(java.util.List<T> list)
This method converts a List of T instance into a Vector of the
same instances
|
static java.util.List |
copyList(java.util.List oList)
This method copies all the element of a List into a new ArrayList instance.
|
static java.util.Map |
copyMap(java.util.Map oMap)
This method makes it possible to clone a Map type object
|
static java.util.Set |
copySet(java.util.Set oSet) |
static java.util.Vector |
copyVector(java.util.Vector oVec)
This method copies all the element of a vector into a new vector.
|
static java.util.List<java.lang.String> |
decomposeUsingToken(java.lang.String definition,
java.lang.String token)
This method decomposes a String into a vector of String instances according to a particular token
|
static java.util.List<java.lang.String> |
extractSequences(java.lang.String originalString,
java.lang.String beginsWith,
java.lang.String endsWith)
This method extracts substrings between particular sequences, typically between "(" and ")".
|
static int |
findMaxInAnArrayOfDouble(double[] oArray)
This static method finds the maximum value in a one-dimension array
|
static int |
findMinInAnArrayOfDouble(double[] oArray)
This static method finds the maximum value in a one-dimension array
|
static java.lang.String |
getBinPath(java.lang.Class anyClass)
This method returns the path of a particular class.
|
static java.lang.String |
getPackagePath(java.lang.Class anyClass)
This method returns the path of a particular class.
|
static java.lang.String |
getRelativePackagePath(java.lang.Class anyClass)
This method returns the relative path of a particular class with respect to the rootpath.
|
static java.lang.String |
getTrueRootPath(java.lang.Class anyClass)
This method returns the root path of the application.
|
static boolean |
isThereAnyElementDifferentFrom(double[][] arrayDouble,
double d) |
static boolean |
isThereAnyElementDifferentFrom(double[] arrayDouble,
double d) |
static java.util.Map |
mergeMaps(java.util.Map map1,
java.util.Map map2)
This method merge the two maps into a third map.
|
static double[] |
multiplyArrayByScalar(double[] array,
double scalar)
This static method returns a new array of double, each double being the product of
the value in the original array and the scalar parameter.
|
static java.net.URI |
relativizeTheseFile(java.io.File parent,
java.io.File child)
This method relativize a given file with respect to a parent file.
|
static java.util.List<java.lang.String> |
splitLine(java.lang.String lineRead,
java.lang.String token)
This method splits a String into a list of string given a particular token and the
possibility of having the \" character.
|
public static final java.lang.String PathSeparator
public static java.util.Map copyMap(java.util.Map oMap)
oMap
- public static java.util.Vector copyVector(java.util.Vector oVec)
oVec
- the source vectorpublic static java.util.List copyList(java.util.List oList)
oList
- the source List instancepublic static java.util.Set copySet(java.util.Set oSet)
public static int findMaxInAnArrayOfDouble(double[] oArray)
oArray
- = an array of double valuespublic static int findMinInAnArrayOfDouble(double[] oArray)
oArray
- = an array of double valuespublic static boolean isThereAnyElementDifferentFrom(double[][] arrayDouble, double d)
public static boolean isThereAnyElementDifferentFrom(double[] arrayDouble, double d)
public static java.util.List<java.lang.String> decomposeUsingToken(java.lang.String definition, java.lang.String token)
definition
- the Stringtoken
- the token that defines the part of the stringpublic static java.lang.String getBinPath(java.lang.Class anyClass)
anyClass
- any class of the systempublic static java.lang.String getTrueRootPath(java.lang.Class anyClass)
anyClass
- any class of the systempublic static java.lang.String getPackagePath(java.lang.Class anyClass)
anyClass
- any class of the systempublic static java.lang.String getRelativePackagePath(java.lang.Class anyClass)
anyClass
- any class of the systempublic static java.util.List<java.lang.String> extractSequences(java.lang.String originalString, java.lang.String beginsWith, java.lang.String endsWith)
originalString
- the original stringbeginsWith
- the sequence that determines the beginningendsWith
- the sequence that determines the endpublic static double[] multiplyArrayByScalar(double[] array, double scalar)
array
- an array of doublescalar
- the product factorpublic static java.util.Map mergeMaps(java.util.Map map1, java.util.Map map2)
map1
- the first map of the mergermap2
- the second map of the mergerpublic static java.net.URI relativizeTheseFile(java.io.File parent, java.io.File child)
parent
- the parent pathchild
- the child pathpublic static <T> java.util.Vector<T> convertFromListToVector(java.util.List<T> list)
list
- a List objectpublic static java.util.List<java.lang.String> splitLine(java.lang.String lineRead, java.lang.String token)
lineRead
- the stringtoken
- the field separator