Class MatrixStringEncoder


  • public class MatrixStringEncoder
    extends Object
    Convert matrix into String and inverse. Method from this class are non "static" to be overriden. Created: 04 mar. 2009
    Version:
    $Revision$ Mise a jour: $Date$ par : $Author$
    Author:
    chatellier
    • Constructor Detail

      • MatrixStringEncoder

        public MatrixStringEncoder()
    • 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 to
        o - 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