public void setSerializedValue( Serializable ser ) { if ( value == null || value.getType() != VALUE_TYPE_SERIALIZABLE ) { value = new ValueSerializable( ser ); } else { value.setSerializable( ser ); } setNull( ser == null ); }
/** * 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(); }
/** * Creates a new row as a duplicate of the given row. The values are copied one by one into new values. * * @param r * The row to be copied. */ // Copy values in row! public Row( Row r ) { this(); for ( int i = 0; i < r.size(); i++ ) { addValue( new Value( r.getValue( i ) ) ); } setIgnore( r.isIgnored() ); }
/** * Sets the Value to a boolean * * @param bool * The boolean to set the Value to */ public void setValue( boolean bool ) { if ( value == null || value.getType() != VALUE_TYPE_BOOLEAN ) { value = new ValueBoolean( bool ); } else { value.setBoolean( bool ); } setNull( false ); }
/** * Sets the Value to a String text * * @param str * The String to get the text from */ public void setValue( String str ) { if ( value == null || value.getType() != VALUE_TYPE_STRING ) { value = new ValueString( str ); } else { value.setString( str ); } setNull( str == null ); }
/** * Sets the Value to a long integer * * @param l * The long integer to which the Value is set. */ public void setValue( long l ) { if ( value == null || value.getType() != VALUE_TYPE_INTEGER ) { value = new ValueInteger( l ); } else { value.setInteger( l ); } setNull( false ); }
/** * Sets the value to a BigDecimal number value. * * @param num * The number value to set the value to */ public void setValue( BigDecimal num ) { if ( value == null || value.getType() != VALUE_TYPE_BIGNUMBER ) { value = new ValueBigNumber( num ); } else { value.setBigNumber( num ); } setNull( false ); }
/** * Sets the value to a double Number value. * * @param num * The number value to set the value to */ public void setValue( double num ) { if ( value == null || value.getType() != VALUE_TYPE_NUMBER ) { value = new ValueNumber( num ); } else { value.setNumber( num ); } setNull( false ); }
/** * 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(); }
/** * Get an array of the names of all the Values in the Row. * * @return an array of Strings: the names of all the Values in the Row. */ public String[] getFieldNames() { String[] retval = new String[size()]; for ( int i = 0; i < size(); i++ ) { retval[i] = getValue( i ).getName(); } return retval; }
/** * Get the BigDecimal number of this Value. If the value is not of type BIG_NUMBER, a conversion is done first. * * @return the double precision floating point number of this Value. */ public BigDecimal getBigNumber() { if ( value == null || isNull() ) { return null; } return value.getBigNumber(); }
public Value bool_not() { value.setBoolean( !getBoolean() ); return this; }
/** * Constructs a new Value with a name. * * @param name * Sets the name of the Value */ public Value( String name ) { // clearValue(); setName( name ); }
/** * Compare 2 complete rows of values with each other. Strings are compared in a case insensitive way * * @param r * the row to compare with * @return -1 if the row is smaller, 0 if both rows are equal, 1 if the row is larger. */ public int compare( Row r ) { return compare( r, true ); }