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 NetBignum extends NumberField {
- Bignum _bigVal;
-
- int getType() {
- return 83;
- }
-
- void readData(ServerObject var1) throws SQLException, IOException, ErrorException {
- String var2 = ((NetString)var1).getString();
- this._bigVal = new Bignum(var2);
- }
-
- void writeData(DataOutputStream var1) throws IOException {
- try {
- NetString var2 = new NetString(this.getString());
- var2.write(var1);
- } catch (SQLException var3) {
- throw new IOException(((Throwable)var3).getMessage());
- }
- }
-
- public String getString() throws SQLException {
- return ((Field)this).isNull() ? null : this._bigVal.toString();
- }
-
- public boolean getBoolean() throws SQLException {
- if (((Field)this).isNull()) {
- return false;
- } else {
- int var1 = this._bigVal.intValue();
- return var1 != 0;
- }
- }
-
- public byte getByte() throws SQLException {
- if (((Field)this).isNull()) {
- return 0;
- } else {
- int var1 = this._bigVal.intValue();
- return (byte)var1;
- }
- }
-
- public short getShort() throws SQLException {
- if (((Field)this).isNull()) {
- return 0;
- } else {
- int var1 = this._bigVal.intValue();
- return (short)var1;
- }
- }
-
- public int getInt() throws SQLException {
- return ((Field)this).isNull() ? 0 : this._bigVal.intValue();
- }
-
- public long getLong() throws SQLException {
- return ((Field)this).isNull() ? 0L : this._bigVal.longValue();
- }
-
- public float getFloat() throws SQLException {
- return ((Field)this).isNull() ? 0.0F : this._bigVal.floatValue();
- }
-
- public double getDouble() throws SQLException {
- return ((Field)this).isNull() ? (double)0.0F : this._bigVal.doubleValue();
- }
-
- public Bignum getBignum(int var1) throws SQLException {
- return ((Field)this).isNull() ? null : new Bignum(this._bigVal, var1);
- }
-
- public void setBoolean(boolean var1) throws SQLException {
- if (var1) {
- this._bigVal = new Bignum(1);
- } else {
- this._bigVal = new Bignum(0);
- }
-
- super._null = false;
- }
-
- public void setByte(byte var1) throws SQLException {
- this._bigVal = new Bignum(var1);
- super._null = false;
- }
-
- public void setShort(short var1) throws SQLException {
- this._bigVal = new Bignum(var1);
- super._null = false;
- }
-
- public void setInt(int var1) throws SQLException {
- this._bigVal = new Bignum(var1);
- super._null = false;
- }
-
- public void setLong(long var1) throws SQLException {
- this._bigVal = new Bignum(var1);
- super._null = false;
- }
-
- public void setFloat(float var1) throws SQLException {
- this._bigVal = new Bignum((double)var1, 0);
- super._null = false;
- }
-
- public void setDouble(double var1) throws SQLException {
- this._bigVal = new Bignum(var1, 0);
- super._null = false;
- }
-
- public void setBignum(Bignum var1) throws SQLException {
- this._bigVal = var1;
- super._null = false;
- }
-
- public void setString(String var1) throws SQLException {
- this._bigVal = new Bignum(var1);
- super._null = false;
- }
-
- public int getSQLType() {
- return 2;
- }
-
- public Object getObject() throws SQLException {
- return new Bignum(this._bigVal);
- }
-
- public void setObject(Object var1) throws SQLException {
- this.setBignum((Bignum)var1);
- }
- }
-