home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataOutputStream;
- import java.io.IOException;
- import symjava.lang.Bignum;
- import symjava.sql.SQLException;
-
- class Real extends NumberField {
- float _fVal;
-
- int getType() {
- return 84;
- }
-
- void readData(ServerObject var1) throws SQLException, IOException, ErrorException {
- this._fVal = ((NetData)var1).getFloat();
- }
-
- void writeData(DataOutputStream var1) throws IOException {
- NetData var2 = new NetData(this._fVal);
- var2.write(var1);
- }
-
- public String getString() throws SQLException {
- return ((Field)this).isNull() ? null : String.valueOf(this._fVal);
- }
-
- public boolean getBoolean() throws SQLException {
- if (((Field)this).isNull()) {
- return false;
- } else {
- return this._fVal != 0.0F;
- }
- }
-
- public byte getByte() throws SQLException {
- return ((Field)this).isNull() ? 0 : (byte)((int)this._fVal);
- }
-
- public short getShort() throws SQLException {
- return ((Field)this).isNull() ? 0 : (short)((int)this._fVal);
- }
-
- public int getInt() throws SQLException {
- return ((Field)this).isNull() ? 0 : (int)this._fVal;
- }
-
- public long getLong() throws SQLException {
- return ((Field)this).isNull() ? 0L : (long)this._fVal;
- }
-
- public float getFloat() throws SQLException {
- return ((Field)this).isNull() ? 0.0F : this._fVal;
- }
-
- public double getDouble() throws SQLException {
- return ((Field)this).isNull() ? (double)0.0F : (double)this._fVal;
- }
-
- public Bignum getBignum(int var1) throws SQLException {
- return ((Field)this).isNull() ? null : new Bignum((double)this._fVal, var1);
- }
-
- public void setBoolean(boolean var1) throws SQLException {
- if (var1) {
- this._fVal = 1.0F;
- } else {
- this._fVal = 0.0F;
- }
-
- super._null = false;
- }
-
- public void setByte(byte var1) throws SQLException {
- this._fVal = (float)var1;
- super._null = false;
- }
-
- public void setShort(short var1) throws SQLException {
- this._fVal = (float)var1;
- super._null = false;
- }
-
- public void setInt(int var1) throws SQLException {
- this._fVal = (float)var1;
- super._null = false;
- }
-
- public void setLong(long var1) throws SQLException {
- this._fVal = (float)var1;
- super._null = false;
- }
-
- public void setFloat(float var1) throws SQLException {
- this._fVal = var1;
- super._null = false;
- }
-
- public void setDouble(double var1) throws SQLException {
- this._fVal = (float)var1;
- super._null = false;
- }
-
- public void setBignum(Bignum var1) throws SQLException {
- this._fVal = var1.floatValue();
- super._null = false;
- }
-
- public void setString(String var1) throws SQLException {
- Float var2 = new Float(var1);
- this._fVal = var2;
- super._null = false;
- }
-
- public int getSQLType() {
- return 7;
- }
-
- public Object getObject() throws SQLException {
- return new Float(this._fVal);
- }
-
- public void setObject(Object var1) throws SQLException {
- this.setFloat((Float)var1);
- }
- }
-