Codota Logo
Value.getBigNumber
Code IndexAdd Codota to your IDE (free)

How to use
getBigNumber
method
in
org.pentaho.di.compatibility.Value

Best Java code snippets using org.pentaho.di.compatibility.Value.getBigNumber (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

/**
 * Check whether this value is equal to the BigDecimal supplied.
 *
 * @param number
 *          The BigDecimal to check for equality
 * @return true if the BigDecimal representation of the value is equal to number.
 */
public boolean isEqualTo( BigDecimal number ) {
 return getBigNumber().equals( number );
}
origin: pentaho/pentaho-kettle

Value v = (Value) Context.jsToJava( value, Value.class );
if ( !v.isNull() ) {
 return v.getBigNumber();
} else {
 return null;
origin: pentaho/pentaho-kettle

public Value trunc() throws KettleValueException {
 if ( isNull() ) {
  return this; // don't do anything, leave it at NULL!
 }
 if ( isInteger() ) {
  // Nothing
  return this;
 }
 if ( isBigNumber() ) {
  getBigNumber().setScale( 0, BigDecimal.ROUND_FLOOR );
 } else if ( isNumber() ) {
  setValue( Math.floor( getNumber() ) );
 } else if ( isDate() ) {
  Calendar cal = Calendar.getInstance();
  cal.setTime( getDate() );
  cal.set( Calendar.MILLISECOND, 0 );
  cal.set( Calendar.SECOND, 0 );
  cal.set( Calendar.MINUTE, 0 );
  cal.set( Calendar.HOUR_OF_DAY, 0 );
  setValue( cal.getTime() );
 } else {
  throw new KettleValueException( "Function TRUNC only works on numbers and dates" );
 }
 return this;
}
origin: pentaho/pentaho-kettle

 getBigNumber().setScale( level, BigDecimal.ROUND_FLOOR );
} else if ( isNumber() ) {
 double pow = Math.pow( 10, level );
origin: pentaho/pentaho-kettle

if ( getBigNumber() == null ) {
 dos.writeInt( -1 ); // -1 == null string
} else {
 String string = getBigNumber().toString();
 dos.writeInt( string.length() );
 dos.writeChars( string );
origin: pentaho/pentaho-kettle

if ( getBigNumber() == null ) {
 dos.writeInt( -1 ); // -1 == null big number
} else {
 String string = getBigNumber().toString();
 dos.writeInt( string.length() );
 dos.writeChars( string );
origin: pentaho/pentaho-kettle

public Value minus( Value v ) throws KettleValueException {
 switch ( getType() ) {
  case VALUE_TYPE_BIGNUMBER:
   value.setBigNumber( getBigNumber().subtract( v.getBigNumber() ) );
   break;
  case VALUE_TYPE_NUMBER:
   value.setNumber( getNumber() - v.getNumber() );
   break;
  case VALUE_TYPE_INTEGER:
   value.setInteger( getInteger() - v.getInteger() );
   break;
  case VALUE_TYPE_BOOLEAN:
  case VALUE_TYPE_STRING:
  default:
   throw new KettleValueException( "Subtraction can only be done with numbers!" );
 }
 return this;
}
origin: pentaho/pentaho-kettle

if ( getBigNumber() != null ) {
 hash ^= getBigNumber().hashCode();
origin: pentaho/pentaho-kettle

public Value abs() throws KettleValueException {
 if ( isNull() ) {
  return this;
 }
 if ( isBigNumber() ) {
  setValue( getBigNumber().abs() );
 } else if ( isNumber() ) {
  setValue( Math.abs( getNumber() ) );
 } else if ( isInteger() ) {
  setValue( Math.abs( getInteger() ) );
 } else {
  throw new KettleValueException( "Function ABS only works with a number" );
 }
 return this;
}
origin: pentaho/pentaho-kettle

public Value divide( Value v ) throws KettleValueException {
 if ( isNull() || v.isNull() ) {
  setNull();
 } else {
  switch ( getType() ) {
   case VALUE_TYPE_BIGNUMBER:
    setValue( getBigNumber().divide( v.getBigNumber(), BigDecimal.ROUND_HALF_UP ) );
    break;
   case VALUE_TYPE_NUMBER:
    setValue( getNumber() / v.getNumber() );
    break;
   case VALUE_TYPE_INTEGER:
    setValue( getInteger() / v.getInteger() );
    break;
   case VALUE_TYPE_BOOLEAN:
   case VALUE_TYPE_STRING:
   default:
    throw new KettleValueException( "Division can only be done with numeric data!" );
  }
 }
 return this;
}
origin: pentaho/pentaho-kettle

public Value plus( Value v ) {
 switch ( getType() ) {
  case VALUE_TYPE_BIGNUMBER:
   setValue( getBigNumber().add( v.getBigNumber() ) );
   break;
  case VALUE_TYPE_NUMBER:
   setValue( getNumber() + v.getNumber() );
   break;
  case VALUE_TYPE_INTEGER:
   setValue( getInteger() + v.getInteger() );
   break;
  case VALUE_TYPE_BOOLEAN:
   setValue( getBoolean() | v.getBoolean() );
   break;
  case VALUE_TYPE_STRING:
   setValue( getString() + v.getString() );
   break;
  default:
   break;
 }
 return this;
}
origin: pentaho/pentaho-kettle

/**
 * Rounds the Number value to a certain number decimal places.
 *
 * @param decimalPlaces
 * @return The rounded Number Value
 * @throws KettleValueException
 *           in case it's not a number (or other problem).
 */
public Value round( int decimalPlaces ) throws KettleValueException {
 if ( isNull() ) {
  return this;
 }
 if ( isNumeric() ) {
  if ( isBigNumber() ) {
   // Multiply by 10^decimalPlaces
   // For example 123.458343938437, Decimalplaces = 2
   //
   BigDecimal bigDec = getBigNumber();
   // System.out.println("ROUND decimalPlaces : "+decimalPlaces+", bigNumber = "+bigDec);
   bigDec = bigDec.setScale( decimalPlaces, BigDecimal.ROUND_HALF_EVEN );
   // System.out.println("ROUND finished result         : "+bigDec);
   setValue( bigDec );
  } else {
   setValue( Const.round( getNumber(), decimalPlaces ) );
  }
 } else {
  throw new KettleValueException( "Function ROUND only works with a number" );
 }
 return this;
}
origin: pentaho/pentaho-kettle

 isNull()
  || ( isString() && ( getString() == null || getString().length() == 0 ) )
  || ( isDate() && getDate() == null ) || ( isBigNumber() && getBigNumber() == null );
boolean n2 =
 v.isNull()
  || ( v.isString() && ( v.getString() == null || v.getString().length() == 0 ) )
  || ( v.isDate() && v.getDate() == null ) || ( v.isBigNumber() && v.getBigNumber() == null );
  return getBigNumber().compareTo( v.getBigNumber() );
origin: pentaho/pentaho-kettle

int cmp = getBigNumber().compareTo( new BigDecimal( 0L ) );
if ( cmp > 0 ) {
 value.setBigNumber( new BigDecimal( 1L ) );
origin: pentaho/pentaho-kettle

} else if ( isBigNumber() || v.isBigNumber() ) {
 setValue( ValueDataUtil.multiplyBigDecimals( getBigNumber(), v.getBigNumber(), null ) );
} else if ( isNumber() || v.isNumber() ) {
origin: pentaho/pentaho-kettle

/**
 * Convert this Value from type String to another type
 *
 * @param newtype
 *          The Value type to convert to.
 */
public void convertString( int newtype ) throws KettleValueException {
 switch ( newtype ) {
  case VALUE_TYPE_STRING:
   break;
  case VALUE_TYPE_NUMBER:
   setValue( getNumber() );
   break;
  case VALUE_TYPE_DATE:
   setValue( getDate() );
   break;
  case VALUE_TYPE_BOOLEAN:
   setValue( getBoolean() );
   break;
  case VALUE_TYPE_INTEGER:
   setValue( getInteger() );
   break;
  case VALUE_TYPE_BIGNUMBER:
   setValue( getBigNumber() );
   break;
  default:
   throw new KettleValueException( "Please specify the type to convert to from String type." );
 }
}
origin: pentaho/pentaho-kettle

 return value.getBoolean();
case ValueMetaInterface.TYPE_BIGNUMBER:
 return value.getBigNumber();
case ValueMetaInterface.TYPE_BINARY:
 return value.getBytes();
origin: pentaho/pentaho-kettle

if ( getBigNumber() == null ) {
 setValue( other.getBigNumber() );
org.pentaho.di.compatibilityValuegetBigNumber

Javadoc

Get the BigDecimal number of this Value. If the value is not of type BIG_NUMBER, a conversion is done first.

Popular methods of Value

  • setValue
    Sets the Value to a byte array
  • <init>
    Construct a new Value and read the data from XML
  • getDate
    Get the Date of this Value. If the Value is not of type DATE, a conversion is done first.
  • getInteger
    Get the long integer representation of this value. If the Value is not of type INTEGER, it will be c
  • getNumber
    Get the double precision floating point number of this Value. If the value is not of type NUMBER, a
  • getString
    Get the String text representing this value. If the value is not of type STRING, a conversion if don
  • isNull
    Checks wheter or not a value is null.
  • setLength
    Sets the length and the precision of the Number, Integer or String to the specified length & precisi
  • setName
    Sets the name of a Value
  • setNull
    Sets or unsets a value to null, no type is being changed.
  • setType
    Set the type of this Value
  • toString
    a String text representation of this Value, optionally padded to the specified length
  • setType,
  • toString,
  • atan2,
  • clearValue,
  • compare,
  • convertString,
  • convertTo,
  • dat2str,
  • divide

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now