if ( getLength() > 0 ) { retval.append( '(' ).append( getLength() ).append( ')' ); if ( getLength() > 0 ) { retval.append( '(' ).append( getLength() ); if ( getPrecision() > 0 ) { retval.append( ", " ).append( getPrecision() ); if ( getLength() > 0 ) { retval.append( '(' ).append( getLength() ).append( ')' );
if ( getLength() < 1 ) { if ( isNull() ) { retval = Const.NULL_INTEGER; if ( isNull() ) { StringBuilder ret = new StringBuilder( Const.NULL_INTEGER ); Const.rightPad( ret, getLength() ); retval = ret.toString(); } else { int len = getLength(); for ( i = 0; i < len; i++ ) { fmt.append( '0' ); // all zeroes.
/** * Produce the XML representation of this value. * * @return a String containing the XML to represent this Value. */ @Override public String getXML() { StringBuilder retval = new StringBuilder( 128 ); retval.append( "<" + XML_TAG + ">" ); retval.append( XMLHandler.addTagValue( "name", getName(), false ) ); retval.append( XMLHandler.addTagValue( "type", getTypeDesc(), false ) ); retval.append( XMLHandler.addTagValue( "text", toString( false ), false ) ); retval.append( XMLHandler.addTagValue( "length", getLength(), false ) ); retval.append( XMLHandler.addTagValue( "precision", getPrecision(), false ) ); retval.append( XMLHandler.addTagValue( "isnull", isNull(), false ) ); retval.append( "</" + XML_TAG + ">" ); return retval.toString(); }
dos.writeInt( getLength() ); dos.writeInt( getPrecision() );
/** * Returns whether "types" of the values are exactly the same: type, name, length, precision. * * @param v * Value to compare type against. * * @return == true when types are the same == false when the types differ */ public boolean equalValueType( Value v, boolean checkTypeOnly ) { if ( v == null ) { return false; } if ( getType() != v.getType() ) { return false; } if ( !checkTypeOnly ) { if ( ( getName() == null && v.getName() != null ) || ( getName() != null && v.getName() == null ) || !( getName().equals( v.getName() ) ) ) { return false; } if ( getLength() != v.getLength() ) { return false; } if ( getPrecision() != v.getPrecision() ) { return false; } } return true; }
/** * 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 ); } }