Package org.pentaho.di.compatibility
Class Value
java.lang.Object
org.pentaho.di.compatibility.Value
- All Implemented Interfaces:
Serializable
,Cloneable
,XMLInterface
This class is one of the core classes of the Kettle framework. It contains everything you need to manipulate atomic
data (Values/Fields/...) and to describe it in the form of meta-data. (name, length, precision, etc.)
- Since:
- Beginning 2003
- Author:
- Matt
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Value type indicating that the value contains a floating point precision number with arbitrary precision.static final int
Value type indicating that the value contains binary data: BLOB, CLOB, ...static final int
Value type indicating that the value contains a boolean.static final int
Value type indicating that the value contains a Date.static final int
Value type indicating that the value contains a long integer.static final int
Value type indicating that the value has no type set.static final int
Value type indicating that the value contains a floating point double precision number.static final int
Value type indicating that the value contains an Object.static final int
Value type indicating that the value contains a text String.static final String
-
Constructor Summary
ConstructorDescriptionValue()
Constructs a new Value of type EMPTYValue
(InputStream is) Read the Value, including meta-data from a DataInputStreamConstructs a new Value with a name.Constructs a new Value of Type VALUE_TYPE_BOOLEAN, with a name, containing a boolean valueConstructs a new Value of Type VALUE_TYPE_BINARY, with a name, containing a bytes valueConstructs a new Value of Type VALUE_TYPE_NUMBER, with a name, containing a numberConstructs a new Value with a name and a type.Constructs a new Value with a name, a type, length and precision.Constructs a new Value of Type VALUE_TYPE_INTEGER, with a name, containing an integer numberConstructs a new Value of Type VALUE_TYPE_STRING, with a name, containing a StringValue
(String name, StringBuffer str) Constructs a new Value of Type VALUE_TYPE_STRING, with a name, containing a StringValue
(String name, StringBuilder str) Constructs a new Value of Type VALUE_TYPE_STRING, with a name, containing a StringValue
(String name, BigDecimal bignum) Constructs a new Value of Type VALUE_TYPE_BIGNUMBER, with a name, containing a BigDecimal numberConstructs a new Value of Type VALUE_TYPE_DATE, with a name, containing a DateConstructs a new Value as a copy of another value and renames it...Constructs a new Value as a copy of another valueValue
(Value metaData, DataInputStream dis) Read the data of a Value from a DataInputStream, the meta-data of the value has to be set before calling this method!Construct a new Value and read the data from XML -
Method Summary
Modifier and TypeMethodDescriptionabs()
acos()
add_days
(long days) Add a number of days to a Date value.add_months
(int months) asin()
atan()
atan2
(double arg0) bool_not()
Change a string into its hexadecimal representation.ceil()
Change a string into its hexadecimal representation.void
Clears the content and name of a Valueclone()
Clone()
Build a copy of this Valueint
Compare 2 values of the same or different type! The comparison of Strings is case insensitiveint
Compare 2 values of the same or different type!void
convertString
(int newtype) Convert this Value from type String to another typecos()
dat2num()
dat2str()
divide
(byte v) divide
(double v) divide
(int v) divide
(long v) divide
(BigDecimal v) e()
boolean
boolean
boolean
equalValueType
(Value v, boolean checkTypeOnly) Returns whether "types" of the values are exactly the same: type, name, length, precision.exp()
floor()
static final String[]
Get an array of String describing the possible types a Value can have.Get the BigDecimal number of this Value.boolean
Get the boolean value of this Value.byte[]
getBytes()
getDate()
Get the Date of this Value.static final Value
long
Get the long integer representation of this value.int
Get the length of this Value.getName()
Obtain the name of a Valuedouble
Get the double precision floating point number of this Value.Obtain the origin of the step.int
get the precision of this ValueGet the Serializable of this Value.Get the String text representing this value.int
Get the length of the String representing this value.int
getType()
Returns the type of this Valuestatic final int
Convert the String description of a type to an integer type.Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ...static final String
getTypeDesc
(int t) Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ...static final String[]
getTypes()
get an array of String describing the possible types a Value can have.getXML()
Produce the XML representation of this value.int
hashCode()
Change a hexadecimal string into normal ASCII representation.Change a hexadecimal string into normal ASCII representation.initcap()
boolean
Checks whether or not the value is a Big Numberboolean
isBinary()
Checks whether or not this value is of type Binaryboolean
Checks whether or not this value is a booleanboolean
isDate()
Checks whether or not this value is a Dateboolean
isEmpty()
Checks whether or not this Value is empty.boolean
isEqualTo
(byte number) Check whether this value is equal to the Integer supplied.boolean
isEqualTo
(double number) Check whether this value is equal to the Number supplied.boolean
isEqualTo
(int number) Check whether this value is equal to the Integer supplied.boolean
isEqualTo
(long number) Check whether this value is equal to the Integer supplied.boolean
Check whether this value is equal to the String supplied.boolean
isEqualTo
(BigDecimal number) Check whether this value is equal to the BigDecimal supplied.boolean
Check whether this value is equal to the Date supplied.boolean
Checks whether or not this value is an Integerboolean
isNull()
Checks wheter or not a value is null.boolean
isNumber()
Checks whether or not the value is a Numberboolean
Checks whether or not this Value is Numeric A Value is numeric if it is either of type Number or Integerstatic final boolean
isNumeric
(int t) Checks whether or not the specified type is either Integer or Numberboolean
Checks whether or not this value is of type Serializableboolean
isString()
Checks wheter or not the value is a String.void
void
jsConstructor
(String name) void
jsConstructor
(String name, String value) last_day()
leftstr
(int len) length()
boolean
Read the data for this Value from an XML Nodelog()
lower()
lpad
(int len) ltrim()
void
Merges another Value.minus
(byte v) minus
(double v) minus
(int v) minus
(long v) minus
(BigDecimal v) mod
(byte arg) mod
(double arg0) mod
(int arg) mod
(long arg) mod
(BigDecimal arg) multiply
(byte v) multiply
(double v) multiply
(int v) multiply
(long v) num2dat()
num2str()
pi()
plus
(byte v) plus
(double v) plus
(int v) plus
(long v) plus
(BigDecimal v) power
(double arg) power
(BigDecimal arg) void
readObj
(DataInputStream dis) Read the metadata and data for this Value object from the specified data input streamrightstr
(int len) round()
Rounds off to the nearest integer.round
(int decimalPlaces) Rounds the Number value to a certain number decimal places.rpad
(int len) rtrim()
void
setLength
(int l) Sets the length of the Number, Integer or String to the specified length Note: no truncation of the value takes place, this is meta-data only!void
setLength
(int l, int p) Sets the length and the precision of the Number, Integer or String to the specified length & precision Note: no truncation of the value takes place, this is meta-data only!void
Sets the name of a Valuevoid
setNull()
Sets the Value to null, no type is being changed.void
setNull
(boolean n) Sets or unsets a value to null, no type is being changed.void
This method allows you to set the origin of the Value by means of the name of the originating step.void
setPrecision
(int p) Sets the precision of this Value Note: no rounding or truncation takes place, this is meta-data only!void
void
setType
(int val_type) Set the type of this Valuevoid
setValue
(boolean bool) Sets the Value to a booleanvoid
setValue
(byte b) Sets the Value to a long integervoid
setValue
(byte[] b) Sets the Value to a byte arrayvoid
setValue
(double num) Sets the value to a double Number value.void
setValue
(int i) Sets the Value to a long integervoid
setValue
(long l) Sets the Value to a long integervoid
void
Sets the Value to a String textvoid
setValue
(StringBuffer str) Sets the Value to a String textvoid
setValue
(StringBuilder str) Sets the Value to a String textvoid
setValue
(BigDecimal num) Sets the value to a BigDecimal number value.void
Sets the Value to a Datevoid
Copy the Value from another Value.void
setValueInterface
(ValueInterface valueInterface) sign()
sin()
sqrt()
startsWith
(String string) startsWith
(Value string) str2num()
substr
(int from) substr
(int from, int to) sysdate()
tan()
toString()
Returns a padded to length String text representation of this ValuetoString
(boolean pad) a String text representation of this Value, optionally padded to the specified lengtha String text representation of this Value, optionally padded to the specified lengthtrim()
Performs a right and left trim of spaces in the string.trunc()
trunc
(double level) trunc
(int level) upper()
void
write
(OutputStream outputStream) Write the value, including the meta-data to a DataOutputStreamboolean
Write the data of this Value, without the meta-data to a DataOutputStreamvoid
writeObj
(DataOutputStream dos)
-
Field Details
-
XML_TAG
- See Also:
-
VALUE_TYPE_NONE
public static final int VALUE_TYPE_NONEValue type indicating that the value has no type set.- See Also:
-
VALUE_TYPE_NUMBER
public static final int VALUE_TYPE_NUMBERValue type indicating that the value contains a floating point double precision number.- See Also:
-
VALUE_TYPE_STRING
public static final int VALUE_TYPE_STRINGValue type indicating that the value contains a text String.- See Also:
-
VALUE_TYPE_DATE
public static final int VALUE_TYPE_DATEValue type indicating that the value contains a Date.- See Also:
-
VALUE_TYPE_BOOLEAN
public static final int VALUE_TYPE_BOOLEANValue type indicating that the value contains a boolean.- See Also:
-
VALUE_TYPE_INTEGER
public static final int VALUE_TYPE_INTEGERValue type indicating that the value contains a long integer.- See Also:
-
VALUE_TYPE_BIGNUMBER
public static final int VALUE_TYPE_BIGNUMBERValue type indicating that the value contains a floating point precision number with arbitrary precision.- See Also:
-
VALUE_TYPE_SERIALIZABLE
public static final int VALUE_TYPE_SERIALIZABLEValue type indicating that the value contains an Object.- See Also:
-
VALUE_TYPE_BINARY
public static final int VALUE_TYPE_BINARYValue type indicating that the value contains binary data: BLOB, CLOB, ...- See Also:
-
-
Constructor Details
-
Value
public Value()Constructs a new Value of type EMPTY -
Value
Constructs a new Value with a name.- Parameters:
name
- Sets the name of the Value
-
Value
Constructs a new Value with a name and a type.- Parameters:
name
- Sets the name of the Valueval_type
- Sets the type of the Value (Value.VALUE_TYPE_*)
-
Value
Constructs a new Value with a name, a type, length and precision.- Parameters:
name
- Sets the name of the ValuevalType
- Sets the type of the Value (Value.VALUE_TYPE_*)length
- The length of the valueprecision
- The precision of the value
-
Value
Constructs a new Value of Type VALUE_TYPE_BIGNUMBER, with a name, containing a BigDecimal number- Parameters:
name
- Sets the name of the Valuebignum
- The number to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_NUMBER, with a name, containing a number- Parameters:
name
- Sets the name of the Valuenum
- The number to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_STRING, with a name, containing a String- Parameters:
name
- Sets the name of the Valuestr
- The text to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_STRING, with a name, containing a String- Parameters:
name
- Sets the name of the Valuestr
- The text to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_STRING, with a name, containing a String- Parameters:
name
- Sets the name of the Valuestr
- The text to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_DATE, with a name, containing a Date- Parameters:
name
- Sets the name of the Valuedat
- The date to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_BOOLEAN, with a name, containing a boolean value- Parameters:
name
- Sets the name of the Valuebool
- The boolean to store in this Value
-
Value
Constructs a new Value of Type VALUE_TYPE_INTEGER, with a name, containing an integer number- Parameters:
name
- Sets the name of the Valuel
- The integer to store in this Value
-
Value
Constructs a new Value as a copy of another value and renames it...- Parameters:
name
- The new name of the copied Valuev
- The value to be copied
-
Value
Constructs a new Value of Type VALUE_TYPE_BINARY, with a name, containing a bytes value- Parameters:
name
- Sets the name of the Valueb
- The bytes to store in this Value
-
Value
Constructs a new Value as a copy of another value- Parameters:
v
- The Value to be copied
-
Value
Read the Value, including meta-data from a DataInputStream- Parameters:
is
- The InputStream to read the value from- Throws:
KettleFileException
- when the Value couldn't be created by reading it from the DataInputStream.
-
Value
Read the data of a Value from a DataInputStream, the meta-data of the value has to be set before calling this method!- Parameters:
dis
- the DataInputStream to read from- Throws:
KettleFileException
- when the value couldn't be read from the DataInputStream
-
Value
Construct a new Value and read the data from XML- Parameters:
valnode
- The XML Node to read from.
-
-
Method Details
-
clone
-
Clone
Build a copy of this Value- Returns:
- a copy of another value
-
clearValue
public void clearValue()Clears the content and name of a Value -
setName
Sets the name of a Value- Parameters:
name
- The new name of the value
-
getName
Obtain the name of a Value- Returns:
- The name of the Value
-
setOrigin
This method allows you to set the origin of the Value by means of the name of the originating step.- Parameters:
step_of_origin
- The step of origin.
-
getOrigin
Obtain the origin of the step.- Returns:
- The name of the originating step
-
setValue
Sets the value to a BigDecimal number value.- Parameters:
num
- The number value to set the value to
-
setValue
public void setValue(double num) Sets the value to a double Number value.- Parameters:
num
- The number value to set the value to
-
setValue
Sets the Value to a String text- Parameters:
str
- The StringBuffer to get the text from
-
setValue
Sets the Value to a String text- Parameters:
str
- The StringBuilder to get the text from
-
setValue
Sets the Value to a String text- Parameters:
str
- The String to get the text from
-
setSerializedValue
-
setValue
Sets the Value to a Date- Parameters:
dat
- The Date to set the Value to
-
setValue
public void setValue(boolean bool) Sets the Value to a boolean- Parameters:
bool
- The boolean to set the Value to
-
setValue
-
setValue
public void setValue(byte b) Sets the Value to a long integer- Parameters:
b
- The byte to convert to a long integer to which the Value is set.
-
setValue
public void setValue(int i) Sets the Value to a long integer- Parameters:
i
- The integer to convert to a long integer to which the Value is set.
-
setValue
public void setValue(long l) Sets the Value to a long integer- Parameters:
l
- The long integer to which the Value is set.
-
setValue
public void setValue(byte[] b) Sets the Value to a byte array- Parameters:
b
- The byte array to which the Value has to be set.
-
setValue
Copy the Value from another Value. It doesn't copy the name.- Parameters:
v
- The Value to copy the settings and value from
-
getBigNumber
Get the BigDecimal number of this Value. If the value is not of type BIG_NUMBER, a conversion is done first.- Returns:
- the double precision floating point number of this Value.
-
getNumber
public double getNumber()Get the double precision floating point number of this Value. If the value is not of type NUMBER, a conversion is done first.- Returns:
- the double precision floating point number of this Value.
-
getString
Get the String text representing this value. If the value is not of type STRING, a conversion if done first.- Returns:
- the String text representing this value.
-
getStringLength
public int getStringLength()Get the length of the String representing this value.- Returns:
- the length of the String representing this value.
-
getDate
Get the Date of this Value. If the Value is not of type DATE, a conversion is done first.- Returns:
- the Date of this Value.
-
getSerializable
Get the Serializable of this Value. If the Value is not of type Serializable, it returns null.- Returns:
- the Serializable of this Value.
-
getBoolean
public boolean getBoolean()Get the boolean value of this Value. If the Value is not of type BOOLEAN, it will be converted.Strings: "YES", "Y", "TRUE" (case insensitive) to true, the rest false
Number: 0.0 is false, the rest is true.
Integer: 0 is false, the rest is true.
Date: always false.
- Returns:
- the boolean representation of this Value.
-
getInteger
public long getInteger()Get the long integer representation of this value. If the Value is not of type INTEGER, it will be converted:String: try to convert to a long value, 0L if it didn't work.
Number: round the double value and return the resulting long integer.
Date: return the number of miliseconds after
1970:01:01 00:00:00
Date: always false.
- Returns:
- the long integer representation of this value.
-
getBytes
public byte[] getBytes() -
setType
public void setType(int val_type) Set the type of this Value- Parameters:
val_type
- The type to which the Value will be set.
-
getType
public int getType()Returns the type of this Value- Returns:
- the type of this Value
-
isEmpty
public boolean isEmpty()Checks whether or not this Value is empty. A value is empty if it has the type VALUE_TYPE_EMPTY- Returns:
- true if the value is empty.
-
isString
public boolean isString()Checks wheter or not the value is a String.- Returns:
- true if the value is a String.
-
isDate
public boolean isDate()Checks whether or not this value is a Date- Returns:
- true if the value is a Date
-
isBigNumber
public boolean isBigNumber()Checks whether or not the value is a Big Number- Returns:
- true is this value is a big number
-
isNumber
public boolean isNumber()Checks whether or not the value is a Number- Returns:
- true is this value is a number
-
isBoolean
public boolean isBoolean()Checks whether or not this value is a boolean- Returns:
- true if this value has type boolean.
-
isSerializableType
public boolean isSerializableType()Checks whether or not this value is of type Serializable- Returns:
- true if this value has type Serializable
-
isBinary
public boolean isBinary()Checks whether or not this value is of type Binary- Returns:
- true if this value has type Binary
-
isInteger
public boolean isInteger()Checks whether or not this value is an Integer- Returns:
- true if this value is an integer
-
isNumeric
public boolean isNumeric()Checks whether or not this Value is Numeric A Value is numeric if it is either of type Number or Integer- Returns:
- true if the value is either of type Number or Integer
-
isNumeric
public static final boolean isNumeric(int t) Checks whether or not the specified type is either Integer or Number- Parameters:
t
- the type to check- Returns:
- true if the type is Integer or Number
-
toString
Returns a padded to length String text representation of this Value -
toString
a String text representation of this Value, optionally padded to the specified length- Parameters:
pad
- true if you want to pad the resulting String- Returns:
- a String text representation of this Value, optionally padded to the specified length
-
toStringMeta
a String text representation of this Value, optionally padded to the specified length- Returns:
- a String text representation of this Value, optionally padded to the specified length
-
setLength
public void setLength(int l) Sets the length of the Number, Integer or String to the specified length Note: no truncation of the value takes place, this is meta-data only!- Parameters:
l
- the length to which you want to set the Value.
-
setLength
public void setLength(int l, int p) Sets the length and the precision of the Number, Integer or String to the specified length & precision Note: no truncation of the value takes place, this is meta-data only!- Parameters:
l
- the length to which you want to set the Value.p
- the precision to which you want to set this Value
-
getLength
public int getLength()Get the length of this Value.- Returns:
- the length of this Value.
-
getPrecision
public int getPrecision()get the precision of this Value- Returns:
- the precision of this Value.
-
setPrecision
public void setPrecision(int p) Sets the precision of this Value Note: no rounding or truncation takes place, this is meta-data only!- Parameters:
p
- the precision to which you want to set this Value.
-
getTypeDesc
Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ...- Returns:
- A String describing the type of value.
-
getTypeDesc
Return the type of a value in a textual form: "String", "Number", "Integer", "Boolean", "Date", ... given a certain integer type- Parameters:
t
- the type to convert to text.- Returns:
- A String describing the type of a certain value.
-
getType
Convert the String description of a type to an integer type.- Parameters:
desc
- The description of the type to convert- Returns:
- The integer type of the given String. (Value.VALUE_TYPE_...)
-
getTypes
get an array of String describing the possible types a Value can have.- Returns:
- an array of String describing the possible types a Value can have.
-
getAllTypes
Get an array of String describing the possible types a Value can have.- Returns:
- an array of String describing the possible types a Value can have.
-
setNull
public void setNull()Sets the Value to null, no type is being changed. -
setNull
public void setNull(boolean n) Sets or unsets a value to null, no type is being changed.- Parameters:
n
- true if you want the value to be null, false if you don't want this to be the case.
-
isNull
public boolean isNull()Checks wheter or not a value is null.- Returns:
- true if the Value is null.
-
writeObj
- Throws:
IOException
-
write
Write the value, including the meta-data to a DataOutputStream- Parameters:
outputStream
- the OutputStream to write to .- Throws:
KettleFileException
- if something goes wrong.
-
readObj
Read the metadata and data for this Value object from the specified data input stream- Parameters:
dis
-- Throws:
IOException
-
writeData
Write the data of this Value, without the meta-data to a DataOutputStream- Parameters:
dos
- The DataOutputStream to write the data to- Returns:
- true if all went well, false if something went wrong.
- Throws:
KettleFileException
-
compare
Compare 2 values of the same or different type! The comparison of Strings is case insensitive- Parameters:
v
- the value to compare with.- Returns:
- -1 if The value was smaller, 1 bigger and 0 if both values are equal.
-
compare
Compare 2 values of the same or different type!- Parameters:
v
- the value to compare with.caseInsensitive
- True if you want the comparison to be case insensitive- Returns:
- -1 if The value was smaller, 1 bigger and 0 if both values are equal.
-
equals
-
isEqualTo
Check whether this value is equal to the String supplied.- Parameters:
string
- The string to check for equality- Returns:
- true if the String representation of the value is equal to string. (ignoring case)
-
isEqualTo
Check whether this value is equal to the BigDecimal supplied.- Parameters:
number
- The BigDecimal to check for equality- Returns:
- true if the BigDecimal representation of the value is equal to number.
-
isEqualTo
public boolean isEqualTo(double number) Check whether this value is equal to the Number supplied.- Parameters:
number
- The Number to check for equality- Returns:
- true if the Number representation of the value is equal to number.
-
isEqualTo
public boolean isEqualTo(long number) Check whether this value is equal to the Integer supplied.- Parameters:
number
- The Integer to check for equality- Returns:
- true if the Integer representation of the value is equal to number.
-
isEqualTo
public boolean isEqualTo(int number) Check whether this value is equal to the Integer supplied.- Parameters:
number
- The Integer to check for equality- Returns:
- true if the Integer representation of the value is equal to number.
-
isEqualTo
public boolean isEqualTo(byte number) Check whether this value is equal to the Integer supplied.- Parameters:
number
- The Integer to check for equality- Returns:
- true if the Integer representation of the value is equal to number.
-
isEqualTo
Check whether this value is equal to the Date supplied.- Parameters:
date
- The Date to check for equality- Returns:
- true if the Date representation of the value is equal to date.
-
hashCode
public int hashCode() -
and
-
xor
-
or
-
bool_and
-
bool_or
-
bool_xor
-
bool_not
-
greater_equal
-
smaller_equal
-
different
-
equal
-
like
-
greater
-
smaller
-
minus
- Throws:
KettleValueException
-
minus
- Throws:
KettleValueException
-
minus
- Throws:
KettleValueException
-
minus
- Throws:
KettleValueException
-
minus
- Throws:
KettleValueException
-
minus
- Throws:
KettleValueException
-
plus
-
plus
-
plus
-
plus
-
plus
-
plus
-
divide
- Throws:
KettleValueException
-
divide
- Throws:
KettleValueException
-
divide
- Throws:
KettleValueException
-
divide
- Throws:
KettleValueException
-
divide
- Throws:
KettleValueException
-
divide
- Throws:
KettleValueException
-
multiply
- Throws:
KettleValueException
-
multiply
- Throws:
KettleValueException
-
multiply
- Throws:
KettleValueException
-
multiply
- Throws:
KettleValueException
-
multiply
- Throws:
KettleValueException
-
multiply
- Throws:
KettleValueException
-
abs
- Throws:
KettleValueException
-
acos
- Throws:
KettleValueException
-
asin
- Throws:
KettleValueException
-
atan
- Throws:
KettleValueException
-
atan2
- Throws:
KettleValueException
-
atan2
- Throws:
KettleValueException
-
ceil
- Throws:
KettleValueException
-
cos
- Throws:
KettleValueException
-
exp
- Throws:
KettleValueException
-
floor
- Throws:
KettleValueException
-
initcap
-
length
- Throws:
KettleValueException
-
log
- Throws:
KettleValueException
-
lower
-
lpad
-
lpad
-
lpad
-
lpad
-
ltrim
-
mod
- Throws:
KettleValueException
-
mod
- Throws:
KettleValueException
-
mod
- Throws:
KettleValueException
-
mod
- Throws:
KettleValueException
-
mod
- Throws:
KettleValueException
-
mod
- Throws:
KettleValueException
-
nvl
-
power
- Throws:
KettleValueException
-
power
- Throws:
KettleValueException
-
power
- Throws:
KettleValueException
-
replace
-
replace
-
round
Rounds off to the nearest integer.See also: java.lang.Math.round()
- Returns:
- The rounded Number value.
- Throws:
KettleValueException
-
round
Rounds the Number value to a certain number decimal places.- Parameters:
decimalPlaces
-- Returns:
- The rounded Number Value
- Throws:
KettleValueException
- in case it's not a number (or other problem).
-
rpad
-
rpad
-
rpad
-
rpad
-
rtrim
-
sign
- Throws:
KettleValueException
-
sin
- Throws:
KettleValueException
-
sqrt
- Throws:
KettleValueException
-
substr
-
substr
-
substr
-
substr
-
rightstr
-
rightstr
-
leftstr
-
leftstr
-
startsWith
-
startsWith
-
sysdate
-
tan
- Throws:
KettleValueException
-
num2str
- Throws:
KettleValueException
-
num2str
- Throws:
KettleValueException
-
num2str
- Throws:
KettleValueException
-
num2str
public Value num2str(String format, String decimalSymbol, String groupingSymbol) throws KettleValueException - Throws:
KettleValueException
-
num2str
public Value num2str(String format, String decimalSymbol, String groupingSymbol, String currencySymbol) throws KettleValueException - Throws:
KettleValueException
-
dat2str
- Throws:
KettleValueException
-
dat2str
- Throws:
KettleValueException
-
dat2str
- Throws:
KettleValueException
-
num2dat
- Throws:
KettleValueException
-
str2dat
- Throws:
KettleValueException
-
str2dat
- Throws:
KettleValueException
-
str2num
- Throws:
KettleValueException
-
str2num
- Throws:
KettleValueException
-
str2num
- Throws:
KettleValueException
-
str2num
- Throws:
KettleValueException
-
str2num
public Value str2num(String pattern, String decimal, String grouping, String currency) throws KettleValueException - Throws:
KettleValueException
-
dat2num
- Throws:
KettleValueException
-
trim
Performs a right and left trim of spaces in the string. If the value is not a string a conversion to String is performed first.- Returns:
- The trimmed string value.
-
upper
-
e
-
pi
-
v_decode
- Throws:
KettleValueException
-
v_if
- Throws:
KettleValueException
-
add_months
- Throws:
KettleValueException
-
add_days
Add a number of days to a Date value.- Parameters:
days
- The number of days to add to the current date value- Returns:
- The resulting value
- Throws:
KettleValueException
-
last_day
- Throws:
KettleValueException
-
first_day
- Throws:
KettleValueException
-
trunc
- Throws:
KettleValueException
-
trunc
- Throws:
KettleValueException
-
trunc
- Throws:
KettleValueException
-
byteToHexEncode
Change a string into its hexadecimal representation. E.g. if Value contains string "a" afterwards it would contain value "61". Note that transformations happen in groups of 2 hex characters, so the value of a characters is always in the range 0-255.- Returns:
- Value itself
- Throws:
KettleValueException
-
hexToByteDecode
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
-
charToHexEncode
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:
- Value itself
- Throws:
KettleValueException
-
hexToCharDecode
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:
- Value itself
- Throws:
KettleValueException
-
getInstance
-
getClassName
-
jsConstructor
public void jsConstructor() -
jsConstructor
-
jsConstructor
-
getXML
Produce the XML representation of this value.- Specified by:
getXML
in interfaceXMLInterface
- Returns:
- a String containing the XML to represent this Value.
-
loadXML
Read the data for this Value from an XML Node- Parameters:
valnode
- The XML Node to read from- Returns:
- true if all went well, false if something went wrong.
-
convertString
Convert this Value from type String to another type- Parameters:
newtype
- The Value type to convert to.- Throws:
KettleValueException
-
equalValueType
-
equalValueType
Returns whether "types" of the values are exactly the same: type, name, length, precision.- Parameters:
v
- Value to compare type against.- Returns:
- == true when types are the same == false when the types differ
-
getValueInterface
-
setValueInterface
-
merge
Merges another Value. That means, that if the other Value has got the same name and is of the same type as this Value, it's real field value is set as this this' value, if our value isnull
or empty- Parameters:
other
- The other value
-