/** * Check whether this value is equal to the Number supplied. * * @param number * The Number to check for equality * @return true if the Number representation of the value is equal to number. */ public boolean isEqualTo( double number ) { return getNumber() == number; }
public Value rightstr( Value len ) { return rightstr( (int) len.getNumber() ); }
public Value leftstr( Value len ) { return leftstr( (int) len.getNumber() ); }
public Value substr( Value from ) { return substr( (int) from.getNumber(), -1 ); }
public Value lpad( Value len ) { return lpad( (int) len.getNumber(), " " ); }
public Value lpad( Value len, Value padstr ) { return lpad( (int) len.getNumber(), padstr.getString() ); }
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 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 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 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 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 atan2( double arg0 ) throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.atan2( getNumber(), arg0 ) ); } else { throw new KettleValueException( "Function ATAN2 only works with numbers" ); } return this; }
public Value log() throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { setValue( Math.log( getNumber() ) ); } else { throw new KettleValueException( "Function LOG only works with a number" ); } return this; }
public Value mod( double arg0 ) throws KettleValueException { if ( isNull() ) { return this; } if ( isNumeric() ) { double n1 = getNumber(); double n2 = arg0; setValue( n1 - ( n2 * Math.floor( n1 / n2 ) ) ); } else { throw new KettleValueException( "Function MOD only works with numeric data" ); } return this; }