📄 datavaluedescriptor.java
字号:
*/ public void setValue(boolean theValue) throws StandardException; /** * Set the value. * * @param theValue Contains the boolean value to set this to * * @return This value * */ /** * Set the value of this DataValueDescriptor. * * @param theValue The byte value to set this DataValueDescriptor to * * @return This DataValueDescriptor * */ public void setValue(byte[] theValue) throws StandardException; /** Set this value from an application supplied java.math.BigDecimal. This is to support the PreparedStatement.setBigDecimal method and similar JDBC methods that allow an application to pass in a BigDecimal to any SQL type. Parameter is declared as java.lang.Number to allow compilation under J2ME/CDC/Foundation. This method will not be called in any environment that does not support java.math.BigDecimal. @param bigDecimal required to be a BigDecimal or null. */ public void setBigDecimal(Number bigDecimal) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The String value to set this DataValueDescriptor to * * @return This DataValueDescriptor * */ public void setValue(String theValue) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The Time value to set this DataValueDescriptor to * * @return This DataValueDescriptor * */ public void setValue(Time theValue) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The Time value to set this DataValueDescriptor to * @param cal The time zone from the calendar is used to construct the database time value * * @return This DataValueDescriptor * */ public void setValue(Time theValue, Calendar cal) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The Timestamp value to set this DataValueDescriptor to * * @return This DataValueDescriptor * */ public void setValue(Timestamp theValue) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The Timestamp value to set this DataValueDescriptor to * @param cal The time zone from the calendar is used to construct the database timestamp value * * @return This DataValueDescriptor * */ public void setValue(Timestamp theValue, Calendar cal) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The Date value to set this DataValueDescriptor to * * @return This DataValueDescriptor * */ public void setValue(Date theValue) throws StandardException; /** * Set the value of this DataValueDescriptor. * * @param theValue The Date value to set this DataValueDescriptor to * @param cal The time zone from the calendar is used to construct the database date value * * @return This DataValueDescriptor * */ public void setValue(Date theValue, Calendar cal) throws StandardException; /** * Set the value of this DataValueDescriptor from another. * * @param theValue The Date value to set this DataValueDescriptor to * * @return This DataValueDescriptor * */ public void setValue(DataValueDescriptor theValue) throws StandardException; /** * Set the value to SQL null. */ void setToNull(); /** Normalize the source value to this type described by this class and the passed in DataTypeDescriptor. The type of the DataTypeDescriptor must match this class. */ public void normalize(DataTypeDescriptor dtd, DataValueDescriptor source) throws StandardException; /** * The SQL "IS NULL" operator. Returns true if this value * is null. * * * @return True if this value is null. * */ public BooleanDataValue isNullOp(); /** * The SQL "IS NOT NULL" operator. Returns true if this value * is not null. * * * @return True if this value is not null. * */ public BooleanDataValue isNotNull(); /** * Get the SQL name of the datatype * * @return The SQL name of the datatype */ public String getTypeName(); /** * Set the Object that this Data Type contains (for an explicit cast). * * @param value The new value * @param instanceOfResultType Whether or not the new value * is an instanceof the result type. * @param resultTypeClassName The class name of the resulting type * (for error messages only). * * @exception StandardException Thrown on error */ public void setObjectForCast( Object value, boolean instanceOfResultType, String resultTypeClassName) throws StandardException; /** * Read the DataValueDescriptor from the stream. * <p> * Initialize the data value by reading it's values from the * ArrayInputStream. This interface is provided as a way to achieve * possible performance enhancement when reading an array can be * optimized over reading from a generic stream from readExternal(). * * @param ais The array stream positioned at the beginning of the * byte stream to read from. * * @exception IOException Usual error is if you try to read * past limit on the stream. * @exception ClassNotFoundException If a necessary class can not be * found while reading the object from * the stream. **/ public void readExternalFromArray( ArrayInputStream ais) throws IOException, ClassNotFoundException; /** * Each built-in type in JSQL has a precedence. This precedence determines * how to do type promotion when using binary operators. For example, float * has a higher precedence than int, so when adding an int to a float, the * result type is float. * * The precedence for some types is arbitrary. For example, it doesn't * matter what the precedence of the boolean type is, since it can't be * mixed with other types. But the precedence for the number types is * critical. The SQL standard requires that exact numeric types be * promoted to approximate numeric when one operator uses both. Also, * the precedence is arranged so that one will not lose precision when * promoting a type. * * @return The precedence of this type. */ int typePrecedence(); /** * The SQL language = operator. This method is called from the language * module. The storage module uses the compare method in Orderable. * * @param left The value on the left side of the operator * @param right The value on the right side of the operator * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue equals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException; /** * The SQL language <> operator. This method is called from the language * module. The storage module uses the compare method in Orderable. * * @param left The value on the left side of the operator * @param right The value on the right side of the operator * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue notEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException; /** * The SQL language < operator. This method is called from the language * module. The storage module uses the compare method in Orderable. * * @param left The value on the left side of the operator * @param right The value on the right side of the operator * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue lessThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException; /** * The SQL language > operator. This method is called from the language * module. The storage module uses the compare method in Orderable. * * @param left The value on the left side of the operator * @param right The value on the right side of the operator * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue greaterThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException; /** * The SQL language <= operator. This method is called from the language * module. The storage module uses the compare method in Orderable. * * @param left The value on the left side of the operator * @param right The value on the right side of the operator * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue lessOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException; /** * The SQL language >= operator. This method is called from the language * module. The storage module uses the compare method in Orderable. * * @param left The value on the left side of the operator * @param right The value on the right side of the operator * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue greaterOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException; /** * The SQL language COALESCE/VALUE function. This method is called from the language * module. * * @param list The list of the arguments. Function will return the first non-nullable argument if any. * @param returnValue The return value is the correct datatype for this function. * The return value of this method is the type of the 2nd parameter. * * @return A DataValueDescriptor which will be either null or first non-null argument * * @exception StandardException Thrown on error */ public DataValueDescriptor coalesce(DataValueDescriptor[] list, DataValueDescriptor returnValue) throws StandardException; /** * The SQL language IN operator. This method is called from the language * module. This method allows us to optimize and short circuit the search * if the list is ordered. * * @param left The value on the left side of the operator * @param inList The values in the IN list * @param orderedList True means that the values in the IN list are ordered, * false means they are not. * * @return A BooleanDataValue telling the result of the comparison * * @exception StandardException Thrown on error */ public BooleanDataValue in(DataValueDescriptor left, DataValueDescriptor[] inList, boolean orderedList) throws StandardException; /** * Compare this Orderable with a given Orderable for the purpose of * index positioning. This method treats nulls as ordered values - * that is, it treats SQL null as equal to null and less than all * other values. * * @param other The Orderable to compare this one to. * * @return <0 - this Orderable is less than other. * 0 - this Orderable equals other. * >0 - this Orderable is greater than other. * * The code should not explicitly look for -1, or 1. * * @exception StandardException Thrown on error */ int compare(DataValueDescriptor other) throws StandardException; /** * Compare this Orderable with a given Orderable for the purpose of * qualification and sorting. The caller gets to determine how nulls * should be treated - they can either be ordered values or unknown * values. * * @param op Orderable.ORDER_OP_EQUALS means do an = comparison. * Orderable.ORDER_OP_LESSTHAN means compare this < other. * Orderable.ORDER_OP_LESSOREQUALS means compare this <= other. * @param other The DataValueDescriptor to compare this one to. * @param orderedNulls True means to treat nulls as ordered values, * that is, treat SQL null as equal to null, and less * than all other values. * False means to treat nulls as unknown values, * that is, the result of any comparison with a null * is the UNKNOWN truth value. * @param unknownRV The return value to use if the result of the * comparison is the UNKNOWN truth value. In other * words, if orderedNulls is false, and a null is * involved in the comparison, return unknownRV. * This parameter is not used orderedNulls is true. * * @return true if the comparison is true (duh!) * * @exception StandardException Thrown on error */ boolean compare( int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException; /** Set the value to be the contents of the stream. The reading of the stream may be delayed until execution time. The format of the stream is required to be the format of this type. @param theStream stream of correctly formatted data @param streamLength logical length of the stream's value in units of this type (e.g. chars for string types). */ public void setValue(InputStream theStream, int streamLength) throws StandardException; /** Check the value to seem if it conforms to the restrictions imposed by DB2/JCC on host variables for this type. @exception StandardException Variable is too big. */ public void checkHostVariable(int declaredLength) throws StandardException; /** * Estimate the memory usage in bytes of the data value and the overhead of the class. * * @return the estimated memory usage */ int estimateMemoryUsage();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -