com.orindasoft.pub
Class PlsqlIndexByTable

java.lang.Object
  |
  +--com.orindasoft.pub.PlsqlIndexByTable

public class PlsqlIndexByTable
extends java.lang.Object

Holds state variables for PL/SQL Index By Table parameters

This class represents an Oracle PL/SQL Index By Table. In addition to the table data it also holds information about the data type of the elements in the table, their maximum length and the maximum number of elements this table can have after an update or retrieval. For this reason this class is always instantiated even for OUT parameters. As of Oracle 10g INDEX BY tables can have two types of parameters - Numbers or Strings. Parameter types can not be mixed within the same table.

Under normal circumstances OrindaBuild users will have no reason to use this class directly - the generated code will use it.


(c) Copyright 2003 - 2010 Orinda Software Ltd

Since:
Oracle 10g/4.0.1798
Version:
6.0
Author:
Orinda Software

Constructor Summary
PlsqlIndexByTable()
          Contruct an empty INDEX BY table
 
Method Summary
 java.lang.Object[] getArray()
          Get the array data
 java.math.BigDecimal[] getArrayAsBigDecimal()
          Get the array data as java.math.BigDecimal[] This convenience method returns the contents of the array as an array of BigDecimal.
 double[] getArrayAsDouble(double nullToken)
          Get the array data as double[] This convenience method returns the contents of the array as an array of double.
 float[] getArrayAsFloat(float nullToken)
          Get the array data as float[] This convenience method returns the contents of the array as an array of float.
 int[] getArrayAsInt(int nullToken)
          Get the array data as int[] This convenience method returns the contents of the array as an array of int.
 long[] getArrayAsLong(long nullToken)
          Get the array data as long[] This convenience method returns the contents of the array as an array of long.
 java.lang.String[] getArrayAsString()
          Get the array data as String[] This convenience method returns the contents of the array as an array of String.
 int getArrayLength()
          Get the length of the array
 int getDataTypeCode()
          Get the underlying OracleType code for the array.
 int getElementMaxCount()
          Get the maximum size this table can be after an update or retrieval.
 int getElementMaxLength()
          Get the maximum length of an element in the table
 void setArray(double[] newArray)
          Set the array data using double[] This convenience method returns sets the array using an array of double[]
 void setArray(float[] newArray)
          Set the array data using float[] This convenience method returns sets the array using an array of float[]
 void setArray(int[] newArray)
          Set the array data using int[] This convenience method returns sets the array using an array of int[]
 void setArray(long[] newArray)
          Set the array data using long[] This convenience method returns sets the array using an array of long[]
 void setArray(java.lang.Object[] dataArray)
          Set the contents of the Array.
 void setDataTypeNumber()
          Set the data type to Numbers
 void setDataTypeString()
          Set the data type to Strings
 void setElementMaxCount(int elementMaxCount)
          Set the maximum size this table can be after an update or retrieval.
 void setElementMaxLength(int elementMaxLength)
          Set the maximum length of an element in the table
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlsqlIndexByTable

public PlsqlIndexByTable()
Contruct an empty INDEX BY table
Method Detail

setElementMaxLength

public void setElementMaxLength(int elementMaxLength)
Set the maximum length of an element in the table

getElementMaxLength

public int getElementMaxLength()
Get the maximum length of an element in the table

setElementMaxCount

public void setElementMaxCount(int elementMaxCount)
Set the maximum size this table can be after an update or retrieval. This is used to decide how big the output array should be.

getElementMaxCount

public int getElementMaxCount()
Get the maximum size this table can be after an update or retrieval.

setDataTypeString

public void setDataTypeString()
Set the data type to Strings

setDataTypeNumber

public void setDataTypeNumber()
Set the data type to Numbers

setArray

public void setArray(java.lang.Object[] dataArray)
Set the contents of the Array. This method assumes that the user is providing a 1 dimensional array of numbers or strings. The values of elementMaxCount and elementMaxLength are updated by this method. If you are passing in an array that will be appended and returned to you you should call setElementMaxCount and setElementMaxLength after calling serArray. 'null' is not an acceptable value for dataArray and will be turned into Object[0]. This is so that getArrayLength works reliably.
Parameters:
Object[] - dataArray
See Also:
setElementMaxCount(int), setElementMaxLength(int)

getDataTypeCode

public int getDataTypeCode()
Get the underlying OracleType code for the array. This is determined by looking at the first element in the array.

getArray

public java.lang.Object[] getArray()
Get the array data

getArrayAsInt

public int[] getArrayAsInt(int nullToken)
Get the array data as int[] This convenience method returns the contents of the array as an array of int. Because the array can have null elements and an 'int' can never be null you need to say how nulls should be treated.
Parameters:
int - nullToken The int you will use to represent null. e.g. Integer.MIN_VALUE
Returns:
int[] An array of numbers. If the array is empty you will get int[0] back.
Throws:
ClassCastException - if the array isn't of numbers.

setArray

public void setArray(int[] newArray)
Set the array data using int[] This convenience method returns sets the array using an array of int[]
Parameters:
int[] - newArray

getArrayAsLong

public long[] getArrayAsLong(long nullToken)
Get the array data as long[] This convenience method returns the contents of the array as an array of long. Because the array can have null elements and a 'long' can never be null you need to say how nulls should be treated.
Parameters:
long - nullToken The long you will use to represent null. e.g. Long.MIN_VALUE
Returns:
long[] An array of numbers. If the array is empty you will get long[0] back.
Throws:
ClassCastException - if the array isn't of numbers.

setArray

public void setArray(long[] newArray)
Set the array data using long[] This convenience method returns sets the array using an array of long[]
Parameters:
long[] - newArray

getArrayAsFloat

public float[] getArrayAsFloat(float nullToken)
Get the array data as float[] This convenience method returns the contents of the array as an array of float. Because the array can have null elements and a 'float' can never be null you need to say how nulls should be treated.
Parameters:
float - nullToken The float you will use to represent null. e.g. Float.MIN_VALUE
Returns:
float[] An array of numbers. If the array is empty you will get float[0] back.
Throws:
ClassCastException - if the array isn't of numbers.

setArray

public void setArray(float[] newArray)
Set the array data using float[] This convenience method returns sets the array using an array of float[]
Parameters:
float[] - newArray

getArrayAsDouble

public double[] getArrayAsDouble(double nullToken)
Get the array data as double[] This convenience method returns the contents of the array as an array of double. Because the array can have null elements and a 'double' can never be null you need to say how nulls should be treated.
Parameters:
double - nullToken The double you will use to represent null. e.g. Double.MIN_VALUE
Returns:
double[] An array of numbers. If the array is empty you will get double[0] back.
Throws:
ClassCastException - if the array isn't of numbers.

setArray

public void setArray(double[] newArray)
Set the array data using double[] This convenience method returns sets the array using an array of double[]
Parameters:
double[] - newArray

getArrayAsString

public java.lang.String[] getArrayAsString()
Get the array data as String[] This convenience method returns the contents of the array as an array of String. Because the array can have null elements and an 'double' can never be null you need to say how nulls should be treated.
Returns:
String[] An array of Strings. If the array is empty you will get double[0] back.

getArrayAsBigDecimal

public java.math.BigDecimal[] getArrayAsBigDecimal()
                                            throws CSException
Get the array data as java.math.BigDecimal[] This convenience method returns the contents of the array as an array of BigDecimal.
Returns:
BigDecimal[] An array of BigDecimal
Throws:
CSException - if this isn't an array of numbers
Since:
OrindaBuild 4.0.2108

getArrayLength

public int getArrayLength()
Get the length of the array


Copyright © Orinda Software Ltd 2010Logo