com.informix.jdbc

## Class IfxIntervalYM

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

    public class IfxIntervalYM
    extends IfxObject

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

See Also:
  `IfxObject`

### Field Summary

### 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
`IfxIntervalYM()` Default Constructor.

### Method Summary

Methods
`void` `fromIfx(byte[] b, int offset, int length, short prec)` Set value of this data type to the given Informix network format
`void` `fromIfx(byte[] b, short prec)` Set value of this data type to the given Informix network format
`void` `fromIntervalYM(IntervalYM YM)` Convert an IntervalYM to this IntervalYM object.
`void` `fromString(java.lang.String str)` Set the values for the interval from a string.
`short` `getEncodedLength()` Return the qualifer value
`byte[]` `toIfx()` Convert value to Informix network format
`byte[]` `toIfxTuple()` Convert value to Informix tuple format
`Interval` `toInterval()` Return the Interval object.
`IntervalYM` `toIntervalYM()` Return the IntervalYM value of this object.
`java.lang.Object` `toObject()` Returns the equivalent Java Object
`java.lang.String` `toString()` Creates a string representation of the interval in the format:
`java.lang.String` `toUnloadString()` Convert to string format which is compatible with format generated by SQL unload command.
`IntervalYM` `value()` accessor

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

`clear, clearWarning, equals, fromAsciiStream, fromAsciiStream, fromBinaryStream, fromBinaryStream, fromBlob, fromBoolean, fromBoolean, fromByte, fromByte, fromBytes, fromCharacterStream, fromCharacterStream, fromClob, fromDate, fromDecimal, fromDecimal, fromDouble, fromDouble, fromFloat, fromFloat, fromIfx, fromIfx, fromIfx, fromIfx, fromInputStream, fromInputStream, fromInt, fromInt, fromIntervalDF, fromLong, fromLong, fromNClob, fromObject, fromObject, fromObject, fromRowId, fromShort, fromShort, fromSQLXML, fromString, fromTime, fromTimestamp, get_used_in_update, getWarning, isNull, nullify, set_used_in_update, setConnection, setExtendedTypeName, setIfxType, setTypeMap, toAsciiStream, toBinaryStream, toBlob, toBoolean, toByte, toBytes, toCharacterStream, toClob, toDate, toDecimal, toDouble, toFloat, toIfxBSONObject, toInputStream, toInt, toIntervalDF, toLong, toNClob, toObject, toRowId, toShort, toSQLXML, toTime, toTimestamp, unnullify`

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

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

### Constructor Detail

#### IfxIntervalYM

    public IfxIntervalYM()
                  throws java.sql.SQLException

Default Constructor.

Throws:
  `java.sql.SQLException`

### Method Detail

#### value

    public IntervalYM value()

accessor

#### 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 tuple format

#### fromIfx

    public void fromIfx(byte[] b,
               short prec)
                 throws java.sql.SQLException

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

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

#### fromIfx

    public void fromIfx(byte[] b,
               int offset,
               int length,
               short prec)
                 throws java.sql.SQLException

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

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

#### toString

    public java.lang.String toString()

Creates a string representation of the interval in the format:

        y-m

Where the presence of the various fields depends upon the qualifier. If no qualifier has been set the default is the full format.

Overrides:
  `toString` in class `IfxObject`
Returns:
  the converted String object, or null on error

#### fromString

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

Set the values for the interval from a string. This is done as a separate method rather than using valueOf since valueOf is usually a class method and this method must use the qualifier property

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

#### toObject

    public java.lang.Object toObject()

Returns the equivalent Java Object

Overrides:
  `toObject` in class `IfxObject`
Returns:
  Java Object

#### toInterval

    public Interval toInterval()
                        throws java.sql.SQLException

Return the Interval object.

Overrides:
  `toInterval` in class `IfxObject`
Returns:
  returns converted Interval object
Throws:
  `java.sql.SQLException` - if the conversion failed

#### toIntervalYM

    public IntervalYM toIntervalYM()
                            throws java.sql.SQLException

Return the IntervalYM value of this object.

Overrides:
  `toIntervalYM` in class `IfxObject`
Returns:
  returns converted IntervalYM value
Throws:
  `java.sql.SQLException` - if the conversion failed

#### fromIntervalYM

    public void fromIntervalYM(IntervalYM YM)
                        throws java.sql.SQLException

Convert an IntervalYM to this IntervalYM object.

Overrides:
  `fromIntervalYM` in class `IfxObject`
Parameters:
  `I` - IntervalYM value to convert
Throws:
  `java.sql.SQLException` - if the conversion failed

#### getEncodedLength

    public short getEncodedLength()

Return the qualifer value

Overrides:
  `getEncodedLength` in class `IfxObject`

#### toUnloadString

    public java.lang.String toUnloadString()

Description copied from class: `IfxObject`
Convert to string format which is compatible with format generated by SQL unload command.

Overrides:
  `toUnloadString` in class `IfxObject`
Returns:
  the converted String object, or null on error