ilog.rules.factory

Class IlrArray

  • java.lang.Object
    • ilog.rules.factory.IlrArray


  • public class IlrArray
    extends java.lang.Object
    This class contains static methods for invoking the XOM API on array classes. This class manage the native Java arrays and the dynamic arrays.
    Since:
    4.0
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.Object get(java.lang.Object array, int index)
      Gets an element of an array.
      static boolean getBoolean(java.lang.Object array, int index)
      Gets an element of an array as a boolean value.
      static byte getByte(java.lang.Object array, int index)
      Gets an element of an array as a byte value.
      static char getChar(java.lang.Object array, int index)
      Gets an element of an array as a char value.
      static double getDouble(java.lang.Object array, int index)
      Gets an element of an array as a double value.
      static float getFloat(java.lang.Object array, int index)
      Gets an element of an array as a float value.
      static int getInt(java.lang.Object array, int index)
      Gets an element of an array as an int value.
      static int getLength(java.lang.Object array)
      Gets the length of an array.
      static long getLong(java.lang.Object array, int index)
      Gets an element of an array as a long value.
      static short getShort(java.lang.Object array, int index)
      Gets an element of an array as a short value.
      static java.lang.Object newInstance(IlrType componentType, int length)
      Deprecated. 
      static java.lang.Object newInstance(IlrType componentType, int[] dimensions)
      Deprecated. 
      static void set(java.lang.Object array, int index, java.lang.Object value)
      Sets an element of an array to a value.
      static void setBoolean(java.lang.Object array, int index, boolean value)
      Sets an element of an array to a boolean value.
      static void setByte(java.lang.Object array, int index, byte b)
      Sets an element of an array to a byte value.
      static void setChar(java.lang.Object array, int index, char c)
      Sets an element of an array to a char value.
      static void setDouble(java.lang.Object array, int index, double d)
      Sets an element of an array to a double value.
      static void setFloat(java.lang.Object array, int index, float f)
      Sets an element of an array to a float value.
      static void setInt(java.lang.Object array, int index, int i)
      Sets an element of an array to an int value.
      static void setLong(java.lang.Object array, int index, long l)
      Sets an element of an array to a long value.
      static void setShort(java.lang.Object array, int index, short s)
      Sets an element of an array to a short value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newInstance

        public static java.lang.Object newInstance(IlrType componentType,
                                   int length)
                                            throws java.lang.NegativeArraySizeException
        Deprecated. As of JRules 6.5, use IlrReflect.newArrayInstance(ilog.rules.bom.IlrType, int) instead.
        Creates an array of type componentType and of length length.
        Throws:
        java.lang.NegativeArraySizeException - If the passed length is negative.
        Parameters:
        componentType - The component type.
        length - The array length.
        Returns:
        An array object.
      • newInstance

        public static java.lang.Object newInstance(IlrType componentType,
                                   int[] dimensions)
                                            throws java.lang.IllegalArgumentException,
                                                   java.lang.NegativeArraySizeException
        Deprecated. As of JRules 6.5, use IlrReflect.newArrayInstance(ilog.rules.bom.IlrType, int[]) instead.
        Creates a multi-dimensional array of type componentType.
        Throws:
        java.lang.NegativeArraySizeException - If the passed length is negative.
        java.lang.IllegalArgumentException
        Parameters:
        componentType - The component type.
        dimensions - The dimensions of the array.
        Returns:
        An array object.
      • getLength

        public static int getLength(java.lang.Object array)
                             throws java.lang.IllegalArgumentException
        Gets the length of an array.
        Throws:
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        Returns:
        The length of the array.
      • get

        public static java.lang.Object get(java.lang.Object array,
                           int index)
                                    throws java.lang.IllegalArgumentException,
                                           java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
      • getBoolean

        public static boolean getBoolean(java.lang.Object array,
                         int index)
                                  throws java.lang.IllegalArgumentException,
                                         java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a boolean value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getChar

        public static char getChar(java.lang.Object array,
                   int index)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a char value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getByte

        public static byte getByte(java.lang.Object array,
                   int index)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a byte value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getShort

        public static short getShort(java.lang.Object array,
                     int index)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a short value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getInt

        public static int getInt(java.lang.Object array,
                 int index)
                          throws java.lang.IllegalArgumentException,
                                 java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as an int value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getLong

        public static long getLong(java.lang.Object array,
                   int index)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a long value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getFloat

        public static float getFloat(java.lang.Object array,
                     int index)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a float value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • getDouble

        public static double getDouble(java.lang.Object array,
                       int index)
                                throws java.lang.IllegalArgumentException,
                                       java.lang.ArrayIndexOutOfBoundsException
        Gets an element of an array as a double value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        Returns:
        The array element at the specified index.
        See Also:
        get(java.lang.Object,int)
      • set

        public static void set(java.lang.Object array,
               int index,
               java.lang.Object value)
                        throws java.lang.IllegalArgumentException,
                               java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        value - The value of the element.
      • setBoolean

        public static void setBoolean(java.lang.Object array,
                      int index,
                      boolean value)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a boolean value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        value - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setChar

        public static void setChar(java.lang.Object array,
                   int index,
                   char c)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a char value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        c - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setByte

        public static void setByte(java.lang.Object array,
                   int index,
                   byte b)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a byte value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        b - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setShort

        public static void setShort(java.lang.Object array,
                    int index,
                    short s)
                             throws java.lang.IllegalArgumentException,
                                    java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a short value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        s - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setInt

        public static void setInt(java.lang.Object array,
                  int index,
                  int i)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to an int value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        i - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setLong

        public static void setLong(java.lang.Object array,
                   int index,
                   long l)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a long value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        l - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setFloat

        public static void setFloat(java.lang.Object array,
                    int index,
                    float f)
                             throws java.lang.IllegalArgumentException,
                                    java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a float value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        f - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)
      • setDouble

        public static void setDouble(java.lang.Object array,
                     int index,
                     double d)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.ArrayIndexOutOfBoundsException
        Sets an element of an array to a double value.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the passed index is greater than the array length.
        java.lang.IllegalArgumentException
        Parameters:
        array - An array object.
        index - The index of the element to get.
        d - The value of the element.
        See Also:
        set(java.lang.Object,int,java.lang.Object)

© Copyright IBM Corp. 1987, 2017