Package org.nuiton.math.matrix
Class MatrixStringEncoder
- java.lang.Object
-
- org.nuiton.math.matrix.MatrixStringEncoder
-
-
Constructor Summary
Constructors Constructor Description MatrixStringEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringBuffer
appendString(StringBuffer buffer, Object o)
Append object type and value.org.apache.commons.beanutils.ConvertUtilsBean
getConverter()
Get commons-beanutils bean converter.String[]
getDimensionNamesFromString(String str)
String to dim names array.String
getDimensionNamesToString(String[] dimNamesArray)
Dim names to string.int[]
getDimFromString(String str)
String to matrix dim.String
getDimToString(int[] dimArray)
Matrix dim to string.String
getMatrixAsString(MatrixND matrix)
Convert a matrix in string representation.MatrixND
getMatrixFromString(String str)
Parse string as matrix representation.String
getQualifiedName(Object o)
Get object qualified name.List<?>[]
getSemanticsFromString(String str)
String to semantics.String
getSemanticsToString(List<?>[] semanticsArray)
Semantics array to string.List<?>
splitObjects(String str)
Recréé chaque object de la chaine de caractere et l'ajoute dans une liste la chaine est de la forme.
-
-
-
Method Detail
-
getMatrixAsString
public String getMatrixAsString(MatrixND matrix)
Convert a matrix in string representation. String representation is composed in (ordered) : - name - dim - dimNames - semantics - data- Parameters:
matrix
- matrix to convert- Returns:
- a
String
representation
-
getMatrixFromString
public MatrixND getMatrixFromString(String str)
Parse string as matrix representation. str must be in following format : - [name,dim,dimNames,semantics,data]- Parameters:
str
-- Returns:
- matrix representation
-
getDimToString
public String getDimToString(int[] dimArray)
Matrix dim to string.- Parameters:
dimArray
- dim to convert.- Returns:
- a
String
representation
-
getDimFromString
public int[] getDimFromString(String str)
String to matrix dim.- Parameters:
str
- string to parse- Returns:
- dim array
-
getDimensionNamesToString
public String getDimensionNamesToString(String[] dimNamesArray)
Dim names to string.- Parameters:
dimNamesArray
- dim array to convert- Returns:
- a
String
representation
-
getDimensionNamesFromString
public String[] getDimensionNamesFromString(String str)
String to dim names array.- Parameters:
str
- string to parse- Returns:
- a
String
representation
-
getSemanticsToString
public String getSemanticsToString(List<?>[] semanticsArray)
Semantics array to string.- Parameters:
semanticsArray
- semantics array- Returns:
- string names array
-
getSemanticsFromString
public List<?>[] getSemanticsFromString(String str)
String to semantics.- Parameters:
str
- la chaine representant la semantique- Returns:
- semantics list
-
splitObjects
public List<?> splitObjects(String str)
Recréé chaque object de la chaine de caractere et l'ajoute dans une liste la chaine est de la forme. [null(), java.lang.String("toto"), ...]- Parameters:
str
- la chaine representant- Returns:
- semantics list
-
appendString
public StringBuffer appendString(StringBuffer buffer, Object o)
Append object type and value. qualifiedName(value) java.lang.String(test) java.lang.Double(4.5)- Parameters:
buffer
- buffer to append too
- object to put on buffer- Returns:
- buffer
-
getQualifiedName
public String getQualifiedName(Object o)
Get object qualified name. Can't be overridden to put another impl.- Parameters:
o
- object to get qualified name- Returns:
- object qualified class name
-
getConverter
public org.apache.commons.beanutils.ConvertUtilsBean getConverter()
Get commons-beanutils bean converter.- Returns:
- a
ConvertUtilsBean
-
-