com.informix.jdbc

## Class IfxInteger

- java.lang.Object
- - com.informix.jdbc.IfxObject
  - - com.informix.jdbc.IfxInteger

    public class IfxInteger
    extends IfxObject

Support for integer datatypes. This class derived from IfxObject class.

See Also:
  `IfxObject`

### Field Summary

Fields
`static int` `IFX_INT_NULL`

### Fields inherited from class com.informix.jdbc.IfxObject

`conn, encodedLength, extendedID, extendedName, extendedOwner, ifxType, isNull, jdbcType, sourceType, trace, typeMap, used_in_update`

### Constructor Summary

Constructors
Constructor and Description
`IfxInteger(int i)` Constructs an IfxInteger given a int

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(java.lang.Object other)` Find out whether two objects are equal.
`void` `fromBoolean(boolean val)` Converted to the integer value.
`void` `fromBoolean(java.lang.Boolean val)`
`void` `fromByte(byte val)` Converted to the byte value.
`void` `fromByte(java.lang.Byte val)`
`void` `fromDecimal(java.math.BigDecimal val)` Converted to the integer value.
`void` `fromDouble(double val)` Converted to the integer value.
`void` `fromDouble(java.lang.Double val)` Converted to the integer value.
`void` `fromFloat(float val)` Converted to the integer value.
`void` `fromFloat(java.lang.Float val)`
`void` `fromIfx(byte[] b)` Set value of this data type to the given Informix network format
`void` `fromIfx(byte[] b, int offset, int length)` Set value of this data type to the given Informix network format
`void` `fromInt(int val)` Update the integer value.
`void` `fromInt(java.lang.Integer val)`
`void` `fromLong(long val)` Update the integer value.
`void` `fromLong(java.lang.Long val)`
`void` `fromShort(short val)` Converted to the integer value.
`void` `fromShort(java.lang.Short val)`
`void` `fromString(java.lang.String str)` Convert from String value.
`short` `getEncodedLength()` Get the encoded length with precision
`boolean` `isIfxNull()` Returns true if this is an Informix NULL
`boolean` `toBoolean()` Return the Boolean value of the object.
`byte` `toByte()` Return the integer value of the object.
`java.math.BigDecimal` `toDecimal()` Return the BigDecimal value of the object.
`double` `toDouble()` Return the double value of the object.
`float` `toFloat()` Return the float value of the object.
`byte[]` `toIfx()` Convert value to Informix network format
`byte[]` `toIfxTuple()` Convert value to Informix tuple format
`int` `toInt()` Return the integer value of the object.
`long` `toLong()` Return the long value of the object.
`java.lang.Object` `toObject()` Return the equivalent Java data object
`short` `toShort()` Return the short value of the object.
`java.lang.String` `toString()` Convert value to a string.

### Methods inherited from class com.informix.jdbc.IfxObject

`clear, clearWarning, fromAsciiStream, fromAsciiStream, fromBinaryStream, fromBinaryStream, fromBlob, fromBytes, fromCharacterStream, fromCharacterStream, fromClob, fromDate, fromDecimal, fromIfx, fromIfx, fromIfx, fromIfx, fromInputStream, fromInputStream, fromIntervalDF, fromIntervalYM, fromNClob, fromObject, fromObject, fromObject, fromRowId, fromSQLXML, fromString, fromTime, fromTimestamp, get_used_in_update, getWarning, isNull, nullify, set_used_in_update, setConnection, setExtendedTypeName, setIfxType, setTypeMap, toAsciiStream, toBinaryStream, toBlob, toBytes, toCharacterStream, toClob, toDate, toIfxBSONObject, toInputStream, toInterval, toIntervalDF, toIntervalYM, toNClob, toObject, toRowId, toSQLXML, toTime, toTimestamp, toUnloadString, unnullify`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### IFX_INT_NULL

    public static final int IFX_INT_NULL

See Also:
  Constant Field Values

### Constructor Detail

#### IfxInteger

    public IfxInteger(int i)
               throws java.sql.SQLException

Constructs an IfxInteger given a int

Parameters:
  `n` - int
Throws:
  `java.sql.SQLException`

### Method Detail

#### toIfx

    public byte[] toIfx()

Convert value to Informix network format

Overrides:
  `toIfx` in class `IfxObject`
Returns:
  a byte array representation of this data type in Informix network format

#### toIfxTuple

    public byte[] toIfxTuple()

Convert value to Informix tuple format

Overrides:
  `toIfxTuple` in class `IfxObject`
Returns:
  a byte array representation of this data type in Informix network format

#### fromIfx

    public void fromIfx(byte[] b)

Set value of this data type to the given Informix network format

Overrides:
  `fromIfx` in class `IfxObject`
Parameters:
  `b` - a byte array representation of this data type in Informix network format

#### fromIfx

    public void fromIfx(byte[] b,
                        int offset,
                        int length)

Set value of this data type to the given Informix network format

Overrides:
  `fromIfx` in class `IfxObject`
Parameters:
  `b` - a byte array representation of this data type in Informix network format
  `offset` - into byte array
  `length` - data length

#### toObject

    public java.lang.Object toObject()

Return the equivalent Java data object

Overrides:
  `toObject` in class `IfxObject`

#### toByte

    public byte toByte()
                throws java.sql.SQLException

Return the integer value of the object.

Overrides:
  `toByte` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromByte

    public void fromByte(byte val)
                  throws java.sql.SQLException

Converted to the byte value.

Overrides:
  `fromByte` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromByte

    public void fromByte(java.lang.Byte val)
                  throws java.sql.SQLException

Overrides:
  `fromByte` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toShort

    public short toShort()
                  throws java.sql.SQLException

Return the short value of the object.

Overrides:
  `toShort` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromShort

    public void fromShort(short val)
                   throws java.sql.SQLException

Converted to the integer value.

Overrides:
  `fromShort` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromShort

    public void fromShort(java.lang.Short val)
                   throws java.sql.SQLException

Overrides:
  `fromShort` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toInt

    public int toInt()
              throws java.sql.SQLException

Return the integer value of the object.

Overrides:
  `toInt` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromInt

    public void fromInt(int val)
                 throws java.sql.SQLException

Update the integer value.

Overrides:
  `fromInt` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromInt

    public void fromInt(java.lang.Integer val)
                 throws java.sql.SQLException

Overrides:
  `fromInt` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toLong

    public long toLong()
                throws java.sql.SQLException

Return the long value of the object.

Overrides:
  `toLong` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromLong

    public void fromLong(long val)
                  throws java.sql.SQLException

Update the integer value.

Overrides:
  `fromLong` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromLong

    public void fromLong(java.lang.Long val)
                  throws java.sql.SQLException

Overrides:
  `fromLong` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toFloat

    public float toFloat()
                  throws java.sql.SQLException

Return the float value of the object.

Overrides:
  `toFloat` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromFloat

    public void fromFloat(float val)
                   throws java.sql.SQLException

Converted to the integer value.

Overrides:
  `fromFloat` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromFloat

    public void fromFloat(java.lang.Float val)
                   throws java.sql.SQLException

Overrides:
  `fromFloat` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toDouble

    public double toDouble()
                    throws java.sql.SQLException

Return the double value of the object.

Overrides:
  `toDouble` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromDouble

    public void fromDouble(double val)
                    throws java.sql.SQLException

Converted to the integer value.

Overrides:
  `fromDouble` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromDouble

    public void fromDouble(java.lang.Double val)
                    throws java.sql.SQLException

Converted to the integer value.

Overrides:
  `fromDouble` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### toDecimal

    public java.math.BigDecimal toDecimal()
                                   throws java.sql.SQLException

Return the BigDecimal value of the object.

Overrides:
  `toDecimal` in class `IfxObject`
Returns:
  the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromDecimal

    public void fromDecimal(java.math.BigDecimal val)
                     throws java.sql.SQLException

Converted to the integer value.

Overrides:
  `fromDecimal` in class `IfxObject`
Parameters:
  `val` - the value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### toBoolean

    public boolean toBoolean()
                      throws java.sql.SQLException

Return the Boolean value of the object.

Overrides:
  `toBoolean` in class `IfxObject`
Returns:
  the boolean value If the value is 0 , then return false Otherwise, return true.
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromBoolean

    public void fromBoolean(boolean val)
                     throws java.sql.SQLException

Converted to the integer value.

Overrides:
  `fromBoolean` in class `IfxObject`
Parameters:
  `val` - the value if val is false, then set the BigDecimal to 0 otherwise, set it to 1
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromBoolean

    public void fromBoolean(java.lang.Boolean val)
                     throws java.sql.SQLException

Overrides:
  `fromBoolean` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toString

    public java.lang.String toString()

Convert value to a string.

Overrides:
  `toString` in class `IfxObject`
Returns:
  a string value representation of the integer, or null on error

#### fromString

    public void fromString(java.lang.String str)
                    throws java.sql.SQLException

Convert from String value.

Overrides:
  `fromString` in class `IfxObject`
Parameters:
  `str` - the String value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### equals

    public boolean equals(java.lang.Object other)

Find out whether two objects are equal.

Overrides:
  `equals` in class `IfxObject`
Parameters:
  `other` - the other object to compare with
Returns:
  true if the objects are equal

#### getEncodedLength

    public short getEncodedLength()

Get the encoded length with precision

Overrides:
  `getEncodedLength` in class `IfxObject`
Returns:
  the encoded length with precision of the object

#### isIfxNull

    public boolean isIfxNull()

Returns true if this is an Informix NULL