com.ibm.as400.access

Interface AS400DataType


    • Method Detail

      • clone

        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

        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

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

        byte[] toBytes(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(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(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

        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

        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.