/** * Get the Date of this Value. If the Value is not of type DATE, a conversion is done first. * * @return the Date of this Value. */ public Date getDate() { if ( value == null || isNull() ) { return null; } return value.getDate(); }
/** * Get the String text representing this value. If the value is not of type STRING, a conversion if done first. * * @return the String text representing this value. */ public String getString() { if ( value == null || isNull() ) { return null; } return value.getString(); }
public Value nvl( Value alt ) { if ( isNull() ) { setValue( alt ); } return this; }
/** * Get the double precision floating point number of this Value. If the value is not of type NUMBER, a conversion is * done first. * * @return the double precision floating point number of this Value. */ public double getNumber() { if ( value == null || isNull() ) { return 0.0; } return value.getNumber(); }
public byte[] getBytes() { if ( value == null || isNull() ) { return null; } return value.getBytes(); }
/** * Get the Serializable of this Value. If the Value is not of type Serializable, it returns null. * * @return the Serializable of this Value. */ public Serializable getSerializable() { if ( value == null || isNull() || value.getType() != VALUE_TYPE_SERIALIZABLE ) { return null; } return value.getSerializable(); }
public Value lower() { if ( isNull() ) { setType( VALUE_TYPE_STRING ); } else { setValue( getString().toLowerCase() ); } return this; }
public Value sin() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.sin( getNumber() ) ); } else { throw new KettleValueException( "Function SIN only works with a number" ); } return this; }
public Value asin() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.asin( getNumber() ) ); } else { throw new KettleValueException( "Function ASIN only works with numeric data" ); } return this; }
public Value exp() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.exp( getNumber() ) ); } else { throw new KettleValueException( "Function EXP only works with a number" ); } return this; }
public Value sqrt() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.sqrt( getNumber() ) ); } else { throw new KettleValueException( "Function SQRT only works with a number" ); } return this; }
public Value tan() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.tan( getNumber() ) ); } else { throw new KettleValueException( "Function TAN only works on a number" ); } return this; }
public Value atan() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.atan( getNumber() ) ); } else { throw new KettleValueException( "Function ATAN only works with numeric data" ); } return this; }
public Value ceil() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.ceil( getNumber() ) ); } else { throw new KettleValueException( "Function CEIL only works with a number" ); } return this; }
public Value cos() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.cos( getNumber() ) ); } else { throw new KettleValueException( "Function COS only works with a number" ); } return this; }
public Value floor() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.floor( getNumber() ) ); } else { throw new KettleValueException( "Function FLOOR only works with a number" ); } return this; }
public Value acos() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.acos( getNumber() ) ); } else { throw new KettleValueException( "Function ACOS only works with numeric data" ); } return this; }
public Value power( Value v ) throws KettleValueException { if ( isNull() ) { return this; } else if ( isNumeric() ) { setValue( Math.pow( getNumber(), v.getNumber() ) ); } else { throw new KettleValueException( "Function POWER only works with numeric data" ); } return this; }
public Value replace( String repl, String with ) { if ( isNull() ) { return this; } if ( getString() == null ) { setNull(); } else { setValue( Const.replace( getString(), repl, with ) ); } return this; }
public Value initcap() { if ( isNull() ) { return this; } if ( getString() == null ) { setNull(); } else { setValue( Const.initCap( getString() ) ); } return this; }