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

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

Best Java code snippets using org.pentaho.di.compatibility.Value.setLength (Showing top 11 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

/**
 * Constructs a new Value with a name, a type, length and precision.
 *
 * @param name
 *          Sets the name of the Value
 * @param valType
 *          Sets the type of the Value (Value.VALUE_TYPE_*)
 * @param length
 *          The length of the value
 * @param precision
 *          The precision of the value
 */
public Value( String name, int valType, int length, int precision ) {
 this( name, valType );
 setLength( length, precision );
}
origin: pentaho/pentaho-kettle

setLength( dis.readInt(), dis.readInt() );
origin: pentaho/pentaho-kettle

public Value lpad( int len, String padstr ) {
 if ( isNull() ) {
  setType( VALUE_TYPE_STRING );
 } else {
  if ( getType() != VALUE_TYPE_STRING ) {
   // also lpad other types!
   setValue( getString() );
  }
  if ( getString() != null ) {
   StringBuilder result = new StringBuilder( getString() );
   int pad = len;
   int l = ( pad - result.length() ) / padstr.length() + 1;
   int i;
   for ( i = 0; i < l; i++ ) {
    result.insert( 0, padstr );
   }
   // Maybe we added one or two too many!
   i = result.length();
   while ( i > pad && pad > 0 ) {
    result.deleteCharAt( 0 );
    i--;
   }
   setValue( result.toString() );
  } else {
   setNull();
  }
 }
 setLength( len );
 return this;
}
origin: pentaho/pentaho-kettle

public Value rpad( int len, String padstr ) {
 if ( isNull() ) {
  setType( VALUE_TYPE_STRING );
 } else {
  if ( getType() != VALUE_TYPE_STRING ) {
   // also rpad other types!
   setValue( getString() );
  }
  if ( getString() != null ) {
   StringBuilder result = new StringBuilder( getString() );
   int pad = len;
   int l = ( pad - result.length() ) / padstr.length() + 1;
   int i;
   for ( i = 0; i < l; i++ ) {
    result.append( padstr );
   }
   // Maybe we added one or two too many!
   i = result.length();
   while ( i > pad && pad > 0 ) {
    result.deleteCharAt( i - 1 );
    i--;
   }
   setValue( result.toString() );
  } else {
   setNull();
  }
 }
 setLength( len );
 return this;
}
origin: pentaho/pentaho-kettle

public Value num2dat() throws KettleValueException {
 if ( isNull() ) {
  setType( VALUE_TYPE_DATE );
 } else {
  if ( isNumeric() ) {
   setValue( new Date( getInteger() ) );
   setLength( -1, -1 );
  } else {
   throw new KettleValueException( "Function NUM2DAT only works on a number" );
  }
 }
 return this;
}
origin: pentaho/pentaho-kettle

public Value str2dat( String arg0, String arg1 ) throws KettleValueException {
 if ( isNull() ) {
  setType( VALUE_TYPE_DATE );
 } else {
  // System.out.println("Convert string ["+string+"] to date using pattern '"+arg0+"'");
  SimpleDateFormat df = new SimpleDateFormat();
  DateFormatSymbols dfs = new DateFormatSymbols();
  if ( arg1 != null ) {
   dfs.setLocalPatternChars( arg1 );
  }
  if ( arg0 != null ) {
   df.applyPattern( arg0 );
  }
  try {
   value.setDate( df.parse( getString() ) );
   setType( VALUE_TYPE_DATE );
   setLength( -1, -1 );
  } catch ( Exception e ) {
   setType( VALUE_TYPE_DATE );
   setNull();
   throw new KettleValueException( "TO_DATE Couldn't convert String to Date" + e.toString() );
  }
 }
 return this;
}
origin: pentaho/pentaho-kettle

 error_found = true;
res.setLength( length[i], precision[i] );
origin: pentaho/pentaho-kettle

 error_found = true;
res.setLength( length[i], precision[i] );
origin: pentaho/pentaho-kettle

/**
 * Constructs a new Value as a copy of another value
 *
 * @param v
 *          The Value to be copied
 */
public Value( Value v ) {
 if ( v != null ) {
  // setType(v.getType()); // Is this really needed???
  value = v.getValueCopy();
  setName( v.getName() );
  setLength( v.getLength(), v.getPrecision() );
  setNull( v.isNull() );
  setOrigin( v.origin );
 } else {
  clearValue();
  setNull( true );
 }
}
origin: pentaho/pentaho-kettle

setLength( len, prec );
origin: pentaho/pentaho-kettle

public Value createOriginalValue( Object data ) throws KettleValueException {
 Value value = new Value( name, type );
 value.setLength( length, precision );
org.pentaho.di.compatibilityValuesetLength

Javadoc

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!

Popular methods of Value

  • setValue
    Sets the Value to a byte array
  • <init>
    Construct a new Value and read the data from XML
  • getBigNumber
    Get the BigDecimal number of this Value. If the value is not of type BIG_NUMBER, a conversion is don
  • 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.
  • 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

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JCheckBox (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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