Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.pentaho.di.core.row
Class ValueDataUtil

    java.lang.Object
      org.pentaho.di.core.row.ValueDataUtil

    public class ValueDataUtil

extends Object

Constructor Summary
`ValueDataUtil()`

Method Summary
`static Object` | `abs(ValueMetaInterface metaA, Object dataA)`
`static Object` | `addDays(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static Object` | `addTimeToDate(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC)`
`static String` | `byteToHexEncode(ValueMetaInterface metaA, Object dataA)` Change a string into its hexadecimal representation.
`static String` | `charToHexEncode(ValueMetaInterface meta, Object data)` Change a string into its hexadecimal representation.
`static Long` | `ChecksumAdler32(ValueMetaInterface metaA, Object dataA)`
`static Long` | `ChecksumCRC32(ValueMetaInterface metaA, Object dataA)`
`static Object` | `combination1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC)` A + B * C
`static Object` | `combination2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)` SQRT( A*A + B*B )
`static String` | `createChecksum(ValueMetaInterface metaA, Object dataA, String type)`
`static Object` | `DateDiff(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static Object` | `dayOfMonth(ValueMetaInterface metaA, Object dataA)`
`static Object` | `dayOfWeek(ValueMetaInterface metaA, Object dataA)`
`static Object` | `dayOfYear(ValueMetaInterface metaA, Object dataA)`
`static Object` | `divide(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static String` | `get_Double_Metaphone(ValueMetaInterface metaA, Object dataA)`
`static String` | `get_Metaphone(ValueMetaInterface metaA, Object dataA)`
`static String` | `getDigits(ValueMetaInterface metaA, Object dataA)`
`static Long` | `getLevenshtein_Distance(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)` Levenshtein distance (LD) is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t).
`static String` | `hexToByteDecode(ValueMetaInterface meta, Object data)` Change a hexadecimal string into normal ASCII representation.
`static String` | `hexToCharDecode(ValueMetaInterface meta, Object data)` Change a hexadecimal string into normal ASCII representation.
`static String` | `initCap(ValueMetaInterface metaA, Object dataA)`
`static boolean` | `isSpace(char c)` Deprecated. Use `Const.isSpace(char)` instead
`static String` | `leftTrim(String string)` Deprecated. Use `Const.ltrim(String)` instead
`static Object` | `loadFileContentInBinary(ValueMetaInterface metaA, Object dataA)`
`static String` | `lowerCase(ValueMetaInterface metaA, Object dataA)`
`static String` | `maskXML(ValueMetaInterface metaA, Object dataA)`
`static Object` | `minus(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static Object` | `monthOfDate(ValueMetaInterface metaA, Object dataA)`
`static Object` | `multiply(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static int` | `nrSpacesAfter(String field)` Count the number of spaces to the right of a text.
`static int` | `nrSpacesBefore(String field)` Count the number of spaces to the left of a text.
`static Object` | `nvl(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static boolean` | `onlySpaces(String str)` Checks whether or not a String consists only of spaces.
`static Object` | `percent1(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)` 100 * A / B
`static Object` | `percent2(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)` A - ( A * B / 100 )
`static Object` | `percent3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)` A + ( A * B / 100 )
`static Object` | `plus(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static Object` | `plus3(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB, ValueMetaInterface metaC, Object dataC)`
`static String` | `removeCR(ValueMetaInterface metaA, Object dataA)`
`static String` | `removeCRLF(ValueMetaInterface metaA, Object dataA)`
`static String` | `removeDigits(ValueMetaInterface metaA, Object dataA)`
`static String` | `removeLF(ValueMetaInterface metaA, Object dataA)`
`static String` | `removeTAB(ValueMetaInterface metaA, Object dataA)`
`static Object` | `removeTimeFromDate(ValueMetaInterface metaA, Object dataA)`
`static String` | `replace(String string, String repl, String with)` Replace value occurances in a String with another value.
`static void` | `replaceBuffer(StringBuffer str, String code, String repl)` Alternate faster version of string replace using a stringbuffer as input.
`static String` | `rightPad(StringBuffer ret, int limit)` Right pad a StringBuffer: adds spaces to a string until a certain length.
`static String` | `rightPad(String ret, int limit)` Right pad a string: adds spaces to a string until a certain length.
`static String` | `rightTrim(String string)` Deprecated. Use `Const.rtrim(String)` instead
`static Object` | `round(ValueMetaInterface metaA, Object dataA)`
`static Object` | `round(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static Object` | `sqrt(ValueMetaInterface metaA, Object dataA)`
`static long` | `stringLen(ValueMetaInterface metaA, Object dataA)`
`static Object` | `sum(ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB)`
`static String` | `trim(String string)` Deprecated. Use `Const.trim(String)` instead
`static String` | `upperCase(ValueMetaInterface metaA, Object dataA)`
`static String` | `useCDATA(ValueMetaInterface metaA, Object dataA)`
`static Object` | `weekOfYear(ValueMetaInterface metaA, Object dataA)`
`static Object` | `weekOfYearISO8601(ValueMetaInterface metaA, Object dataA)`
`static Object` | `yearOfDate(ValueMetaInterface metaA, Object dataA)`
`static Object` | `yearOfDateISO8601(ValueMetaInterface metaA, Object dataA)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ValueDataUtil

    public ValueDataUtil()

Method Detail

### leftTrim

    public static final String leftTrim(String string)

  Deprecated. Use `Const.ltrim(String)` instead

### rightTrim

    public static final String rightTrim(String string)

  Deprecated. Use `Const.rtrim(String)` instead

### isSpace

    public static final boolean isSpace(char c)

  Deprecated. Use `Const.isSpace(char)` instead

  Determines whether or not a character is considered a space. A character is considered a space in Kettle if it is a space, a tab, a newline or a cariage return.

  Parameters:
    `c` - The character to verify if it is a space.
  Returns:
    true if the character is a space. false otherwise.

### trim

    public static final String trim(String string)

  Deprecated. Use `Const.trim(String)` instead

  Trims a string: removes the leading and trailing spaces of a String.

  Parameters:
    `string` - The string to trim
  Returns:
    The trimmed string.

### getLevenshtein_Distance

    public static Long getLevenshtein_Distance(ValueMetaInterface metaA,
                                               Object dataA,
                                               ValueMetaInterface metaB,
                                               Object dataB)

  Levenshtein distance (LD) is a measure of the similarity between two strings, which we will refer to as the source string (s) and the target string (t). The distance is the number of deletions, insertions, or substitutions required to transform s into t.

### get_Metaphone

    public static String get_Metaphone(ValueMetaInterface metaA,
                                       Object dataA)

### get_Double_Metaphone

    public static String get_Double_Metaphone(ValueMetaInterface metaA,
                                              Object dataA)

### initCap

    public static String initCap(ValueMetaInterface metaA,
                                 Object dataA)

### upperCase

    public static String upperCase(ValueMetaInterface metaA,
                                   Object dataA)

### lowerCase

    public static String lowerCase(ValueMetaInterface metaA,
                                   Object dataA)

### maskXML

    public static String maskXML(ValueMetaInterface metaA,
                                 Object dataA)

### useCDATA

    public static String useCDATA(ValueMetaInterface metaA,
                                  Object dataA)

### removeCR

    public static String removeCR(ValueMetaInterface metaA,
                                  Object dataA)

### removeLF

    public static String removeLF(ValueMetaInterface metaA,
                                  Object dataA)

### removeCRLF

    public static String removeCRLF(ValueMetaInterface metaA,
                                    Object dataA)

### removeTAB

    public static String removeTAB(ValueMetaInterface metaA,
                                   Object dataA)

### getDigits

    public static String getDigits(ValueMetaInterface metaA,
                                   Object dataA)

### removeDigits

    public static String removeDigits(ValueMetaInterface metaA,
                                      Object dataA)

### stringLen

    public static long stringLen(ValueMetaInterface metaA,
                                 Object dataA)

### createChecksum

    public static String createChecksum(ValueMetaInterface metaA,
                                        Object dataA,
                                        String type)

### ChecksumCRC32

    public static Long ChecksumCRC32(ValueMetaInterface metaA,
                                     Object dataA)

### ChecksumAdler32

    public static Long ChecksumAdler32(ValueMetaInterface metaA,
                                       Object dataA)

### plus

    public static Object plus(ValueMetaInterface metaA,
                              Object dataA,
                              ValueMetaInterface metaB,
                              Object dataB)
                       throws KettleValueException

  Throws:
    `KettleValueException`

### plus3

    public static Object plus3(ValueMetaInterface metaA,
                               Object dataA,
                               ValueMetaInterface metaB,
                               Object dataB,
                               ValueMetaInterface metaC,
                               Object dataC)
                        throws KettleValueException

  Throws:
    `KettleValueException`

### sum

    public static Object sum(ValueMetaInterface metaA,
                             Object dataA,
                             ValueMetaInterface metaB,
                             Object dataB)
                      throws KettleValueException

  Throws:
    `KettleValueException`

### loadFileContentInBinary

    public static Object loadFileContentInBinary(ValueMetaInterface metaA,
                                                 Object dataA)
                                          throws KettleValueException

  Throws:
    `KettleValueException`

### minus

    public static Object minus(ValueMetaInterface metaA,
                               Object dataA,
                               ValueMetaInterface metaB,
                               Object dataB)
                        throws KettleValueException

  Throws:
    `KettleValueException`

### multiply

    public static Object multiply(ValueMetaInterface metaA,
                                  Object dataA,
                                  ValueMetaInterface metaB,
                                  Object dataB)
                           throws KettleValueException

  Throws:
    `KettleValueException`

### divide

    public static Object divide(ValueMetaInterface metaA,
                                Object dataA,
                                ValueMetaInterface metaB,
                                Object dataB)
                         throws KettleValueException

  Throws:
    `KettleValueException`

### sqrt

    public static Object sqrt(ValueMetaInterface metaA,
                              Object dataA)
                       throws KettleValueException

  Throws:
    `KettleValueException`

### percent1

    public static Object percent1(ValueMetaInterface metaA,
                                  Object dataA,
                                  ValueMetaInterface metaB,
                                  Object dataB)
                           throws KettleValueException

  100 * A / B

  Parameters:
    `metaA` -
    `dataA` -
    `metaB` -
    `dataB` -
  Returns:
  Throws:
    `KettleValueException`

### percent2

    public static Object percent2(ValueMetaInterface metaA,
                                  Object dataA,
                                  ValueMetaInterface metaB,
                                  Object dataB)
                           throws KettleValueException

  A - ( A * B / 100 )

  Parameters:
    `metaA` -
    `dataA` -
    `metaB` -
    `dataB` -
  Returns:
  Throws:
    `KettleValueException`

### percent3

    public static Object percent3(ValueMetaInterface metaA,
                                  Object dataA,
                                  ValueMetaInterface metaB,
                                  Object dataB)
                           throws KettleValueException

  A + ( A * B / 100 )

  Parameters:
    `metaA` -
    `dataA` -
    `metaB` -
    `dataB` -
  Returns:
  Throws:
    `KettleValueException`

### combination1

    public static Object combination1(ValueMetaInterface metaA,
                                      Object dataA,
                                      ValueMetaInterface metaB,
                                      Object dataB,
                                      ValueMetaInterface metaC,
                                      Object dataC)
                               throws KettleValueException

  A + B * C

  Parameters:
    `metaA` -
    `dataA` -
    `metaB` -
    `dataB` -
  Returns:
  Throws:
    `KettleValueException`

### combination2

    public static Object combination2(ValueMetaInterface metaA,
                                      Object dataA,
                                      ValueMetaInterface metaB,
                                      Object dataB)
                               throws KettleValueException

  SQRT( A*A + B*B )

  Parameters:
    `metaA` -
    `dataA` -
    `metaB` -
    `dataB` -
  Returns:
  Throws:
    `KettleValueException`

### round

    public static Object round(ValueMetaInterface metaA,
                               Object dataA)
                        throws KettleValueException

  Throws:
    `KettleValueException`

### abs

    public static Object abs(ValueMetaInterface metaA,
                             Object dataA)
                      throws KettleValueException

  Throws:
    `KettleValueException`

### round

    public static Object round(ValueMetaInterface metaA,
                               Object dataA,
                               ValueMetaInterface metaB,
                               Object dataB)
                        throws KettleValueException

  Throws:
    `KettleValueException`

### nvl

    public static Object nvl(ValueMetaInterface metaA,
                             Object dataA,
                             ValueMetaInterface metaB,
                             Object dataB)
                      throws KettleValueException

  Throws:
    `KettleValueException`

### removeTimeFromDate

    public static Object removeTimeFromDate(ValueMetaInterface metaA,
                                            Object dataA)
                                     throws KettleValueException

  Throws:
    `KettleValueException`

### addTimeToDate

    public static Object addTimeToDate(ValueMetaInterface metaA,
                                       Object dataA,
                                       ValueMetaInterface metaB,
                                       Object dataB,
                                       ValueMetaInterface metaC,
                                       Object dataC)
                                throws KettleValueException

  Throws:
    `KettleValueException`

### addDays

    public static Object addDays(ValueMetaInterface metaA,
                                 Object dataA,
                                 ValueMetaInterface metaB,
                                 Object dataB)
                          throws KettleValueException

  Throws:
    `KettleValueException`

### DateDiff

    public static Object DateDiff(ValueMetaInterface metaA,
                                  Object dataA,
                                  ValueMetaInterface metaB,
                                  Object dataB)
                           throws KettleValueException

  Throws:
    `KettleValueException`

### yearOfDate

    public static Object yearOfDate(ValueMetaInterface metaA,
                                    Object dataA)
                             throws KettleValueException

  Throws:
    `KettleValueException`

### monthOfDate

    public static Object monthOfDate(ValueMetaInterface metaA,
                                     Object dataA)
                              throws KettleValueException

  Throws:
    `KettleValueException`

### dayOfYear

    public static Object dayOfYear(ValueMetaInterface metaA,
                                   Object dataA)
                            throws KettleValueException

  Throws:
    `KettleValueException`

### dayOfMonth

    public static Object dayOfMonth(ValueMetaInterface metaA,
                                    Object dataA)
                             throws KettleValueException

  Throws:
    `KettleValueException`

### dayOfWeek

    public static Object dayOfWeek(ValueMetaInterface metaA,
                                   Object dataA)
                            throws KettleValueException

  Throws:
    `KettleValueException`

### weekOfYear

    public static Object weekOfYear(ValueMetaInterface metaA,
                                    Object dataA)
                             throws KettleValueException

  Throws:
    `KettleValueException`

### weekOfYearISO8601

    public static Object weekOfYearISO8601(ValueMetaInterface metaA,
                                           Object dataA)
                                    throws KettleValueException

  Throws:
    `KettleValueException`

### yearOfDateISO8601

    public static Object yearOfDateISO8601(ValueMetaInterface metaA,
                                           Object dataA)
                                    throws KettleValueException

  Throws:
    `KettleValueException`

### hexToByteDecode

    public static String hexToByteDecode(ValueMetaInterface meta,
                                         Object data)
                                  throws KettleValueException

  Change a hexadecimal string into normal ASCII representation. E.g. if Value contains string "61" afterwards it would contain value "a". If the hexadecimal string is of odd length a leading zero will be used. Note that only the low byte of a character will be processed, this is for binary transformations.

  Returns:
    Value itself
  Throws:
    `KettleValueException`

### byteToHexEncode

    public static String byteToHexEncode(ValueMetaInterface metaA,
                                         Object dataA)
                                  throws KettleValueException

  Change a string into its hexadecimal representation. E.g. if Value contains string "a" afterwards it would contain value "0061". Note that transformations happen in groups of 4 hex characters, so the value of a characters is always in the range 0-65535.

  Returns:
  Throws:
    `KettleValueException`

### charToHexEncode

    public static String charToHexEncode(ValueMetaInterface meta,
                                         Object data)
                                  throws KettleValueException

  Change a string into its hexadecimal representation. E.g. if Value contains string "a" afterwards it would contain value "0061". Note that transformations happen in groups of 4 hex characters, so the value of a characters is always in the range 0-65535.

  Returns:
    A string with Hex code
  Throws:
    `KettleValueException` - In case of a data conversion problem.

### hexToCharDecode

    public static String hexToCharDecode(ValueMetaInterface meta,
                                         Object data)
                                  throws KettleValueException

  Change a hexadecimal string into normal ASCII representation. E.g. if Value contains string "61" afterwards it would contain value "a". If the hexadecimal string is of a wrong length leading zeroes will be used. Note that transformations happen in groups of 4 hex characters, so the value of a characters is always in the range 0-65535.

  Returns:
    A hex-to-char decoded String
  Throws:
    `KettleValueException`

### rightPad

    public static final String rightPad(String ret,
                                        int limit)

  Right pad a string: adds spaces to a string until a certain length. If the length is smaller then the limit specified, the String is truncated.

  Parameters:
    `ret` - The string to pad
    `limit` - The desired length of the padded string.
  Returns:
    The padded String.

### rightPad

    public static final String rightPad(StringBuffer ret,
                                        int limit)

  Right pad a StringBuffer: adds spaces to a string until a certain length. If the length is smaller then the limit specified, the String is truncated.

  Parameters:
    `ret` - The StringBuffer to pad
    `limit` - The desired length of the padded string.
  Returns:
    The padded String.

### replace

    public static final String replace(String string,
                                       String repl,
                                       String with)

  Replace value occurances in a String with another value.

  Parameters:
    `string` - The original String.
    `repl` - The text to replace
    `with` - The new text bit
  Returns:
    The resulting string with the text pieces replaced.

### replaceBuffer

    public static void replaceBuffer(StringBuffer str,
                                     String code,
                                     String repl)

  Alternate faster version of string replace using a stringbuffer as input.

  Parameters:
    `str` - The string where we want to replace in
    `code` - The code to search for
    `repl` - The replacement string for code

### nrSpacesBefore

    public static final int nrSpacesBefore(String field)

  Count the number of spaces to the left of a text. (leading)

  Parameters:
    `field` - The text to examine
  Returns:
    The number of leading spaces found.

### nrSpacesAfter

    public static final int nrSpacesAfter(String field)

  Count the number of spaces to the right of a text. (trailing)

  Parameters:
    `field` - The text to examine
  Returns:
    The number of trailing spaces found.

### onlySpaces

    public static final boolean onlySpaces(String str)

  Checks whether or not a String consists only of spaces.

  Parameters:
    `str` - The string to check
  Returns:
    true if the string has nothing but spaces.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD