com.ibm.as400.access

Interface AS400DataType

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Object clone()
      Creates a new AS400DataType object that is identical to the current instance.
      int getByteLength()
      Returns the byte length of the data type.
      java.lang.Object getDefaultValue()
      Returns a Java object representing the default value of the data type.
      int getInstanceType()
      Returns an integer constant representing the type of class that implements this interface.
      java.lang.Class getJavaType()
      Returns the Java class that corresponds with this data type.
      byte[] toBytes(java.lang.Object javaValue)
      Converts the specified Java object to IBM i format.
      int toBytes(java.lang.Object javaValue, byte[] as400Value)
      Converts the specified Java object into IBM i format in the specified byte array.
      int toBytes(java.lang.Object javaValue, byte[] as400Value, int offset)
      Converts the specified Java object into IBM i format in the specified byte array.
      java.lang.Object toObject(byte[] as400Value)
      Converts the specified IBM i data type to a Java object.
      java.lang.Object toObject(byte[] as400Value, int offset)
      Converts the specified IBM i data type to a Java object.
    • Method Detail

      • clone

        java.lang.Object clone()
        Creates a new AS400DataType object that is identical to the current instance.
        Returns:
        The new object.
      • getByteLength

        int getByteLength()
        Returns the byte length of the data type.
        Returns:
        The number of bytes in the IBM i representation of the data type.
      • getDefaultValue

        java.lang.Object getDefaultValue()
        Returns a Java object representing the default value of the data type.
        Returns:
        The Object of the corresponding data type.
      • getInstanceType

        int getInstanceType()
        Returns an integer constant representing the type of class that implements this interface. This is typically faster than using the instanceof operator, and may prove useful where code needs a primitive type for ease of calculation. Possible values for standard com.ibm.as400.access classes that implement this interface are provided as constants in this class. Note that any implementing class provided by a third party is not guaranteed to correctly return one of the pre-defined constants.
        Returns:
        The type of object implementing this interface.
      • getJavaType

        java.lang.Class getJavaType()
        Returns the Java class that corresponds with this data type.
        Returns:
        The corresponding Java class for this data type.
      • toBytes

        byte[] toBytes(java.lang.Object javaValue)
        Converts the specified Java object to IBM i format.
        Parameters:
        javaValue - The object corresponding to the data type. It must be an instance of the correct type.
        Returns:
        The IBM i representation of the data type.
      • toBytes

        int toBytes(java.lang.Object javaValue,
                  byte[] as400Value)
        Converts the specified Java object into IBM i format in the specified byte array.
        Parameters:
        javaValue - The object corresponding to the data type. It must be an instance of the correct type.
        as400Value - The array to receive the data type in IBM i format. There must be enough space to hold the IBM i value.
        Returns:
        The number of bytes in the IBM i representation of the data type.
      • toBytes

        int toBytes(java.lang.Object javaValue,
                  byte[] as400Value,
                  int offset)
        Converts the specified Java object into IBM i format in the specified byte array.
        Parameters:
        javaValue - The object corresponding to the data type. It must be an instance of the correct type.
        as400Value - The array to receive the data type in IBM i format. There must be enough space to hold the IBM i value.
        offset - The offset into the byte array for the start of the IBM i value. It must be greater than or equal to zero.
        Returns:
        The number of bytes in the IBM i representation of the data type.
      • toObject

        java.lang.Object toObject(byte[] as400Value)
        Converts the specified IBM i data type to a Java object.
        Parameters:
        as400Value - The array containing the data type in IBM i format. The entire data type must be represented.
        Returns:
        The object corresponding to the data type.
      • toObject

        java.lang.Object toObject(byte[] as400Value,
                                int offset)
        Converts the specified IBM i data type to a Java object.
        Parameters:
        as400Value - The array containing the data type in IBM i format. The entire data type must be represented.
        offset - The offset into the byte array for the start of the IBM i value. It must be greater than or equal to zero.
        Returns:
        The object corresponding to the data type.