📄 datavaluefactory.java
字号:
/* Derby - Class org.apache.derby.iapi.types.DataValueFactory Copyright 1999, 2004 The Apache Software Foundation or its licensors, as applicable. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */package org.apache.derby.iapi.types;import org.apache.derby.iapi.types.RowLocation;import org.apache.derby.iapi.error.StandardException;import java.sql.Date;import java.sql.Time;import java.sql.Timestamp;/** * This interface is how we get constant data values of different types. */public interface DataValueFactory{ /** * Get a SQL int with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ NumberDataValue getDataValue(Integer value); NumberDataValue getDataValue(Integer value, NumberDataValue previous) throws StandardException; /** * Get a SQL int with a char value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ public NumberDataValue getDataValue(char value); public NumberDataValue getDataValue(char value, NumberDataValue previous) throws StandardException; /** * Get a SQL smallint with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ NumberDataValue getDataValue(Short value); NumberDataValue getDataValue(Short value, NumberDataValue previous) throws StandardException; /** * Get a SQL TINYINT with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ NumberDataValue getDataValue(Byte value); NumberDataValue getDataValue(Byte value, NumberDataValue previous) throws StandardException; /** * Get a SQL bigint with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ NumberDataValue getDataValue(Long value); NumberDataValue getDataValue(Long value, NumberDataValue previous) throws StandardException; /** * Get a SQL real with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ NumberDataValue getDataValue(Float value) throws StandardException; NumberDataValue getDataValue(Float value, NumberDataValue previous) throws StandardException; /** * Get a SQL double precision with the given value. A null argument means * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * * @exception StandardException Thrown on error */ NumberDataValue getDataValue(Double value) throws StandardException; NumberDataValue getDataValue(Double value, NumberDataValue previous) throws StandardException; /** * Get a SQL boolean with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ BooleanDataValue getDataValue(Boolean value); BooleanDataValue getDataValue(Boolean value, BooleanDataValue previous) throws StandardException; // ------ LONGVARBIT /** * Get a SQL Long Bit Varying with the given value. A null argument means * get a SQL null value. The second form uses the previous value (if * non-null) to hold the return value. * * @exception StandardException Thrown on error */ BitDataValue getLongVarbitDataValue(byte[] value) throws StandardException; BitDataValue getLongVarbitDataValue(byte[] value, BitDataValue previous) throws StandardException; // ------ BLOB /** * Get a SQL Blob with the given value. A null argument means * get a SQL null value. The second form uses the previous value (if * non-null) to hold the return value. * * @exception StandardException Thrown on error */ BitDataValue getBlobDataValue(byte[] value) throws StandardException; BitDataValue getBlobDataValue(byte[] value, BitDataValue previous) throws StandardException; // ------ BOOLEAN /** * Get a SQL boolean with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * * @exception StandardException Thrown on error */ BooleanDataValue getDataValue(BooleanDataValue value) throws StandardException; /** * Get a SQL varchar with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ StringDataValue getVarcharDataValue(String value); StringDataValue getVarcharDataValue(String value, StringDataValue previous) throws StandardException; /** * Get a SQL long varchar with the given value. A null argument means * get a SQL null value. The second form uses the previous value * (if non-null) to hold the return value. * */ StringDataValue getLongvarcharDataValue(String value); StringDataValue getLongvarcharDataValue(String value, StringDataValue previous) throws StandardException; /** * Get a SQL Clob with the given value. A null argument means * get a SQL null value. The second form uses the previous value * (if non-null) to hold the return value. * */ StringDataValue getClobDataValue(String value); StringDataValue getClobDataValue(String value, StringDataValue previous) throws StandardException; /** * Get a SQL national varchar with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. */ StringDataValue getNationalVarcharDataValue(String value); StringDataValue getNationalVarcharDataValue(String value, StringDataValue previous) throws StandardException; /** * Get a SQL national long varchar with the given value. A null argument means * get a SQL null value. The second form uses the previous value * (if non-null) to hold the return value. */ StringDataValue getNationalLongvarcharDataValue(String value); StringDataValue getNationalLongvarcharDataValue(String value, StringDataValue previous) throws StandardException; /** * Get a SQL national blob with the given value. A null argument means * get a SQL null value. The second form uses the previous value * (if non-null) to hold the return value. */ StringDataValue getNClobDataValue(String value); StringDataValue getNClobDataValue(String value, StringDataValue previous) throws StandardException; /** * Get a User-defined data value with the given value and type name. * A null argument means get a SQL null value. The second form uses * the previous value (if non-null) hold the return value. * */ UserDataValue getDataValue(Object value); UserDataValue getDataValue(Object value, UserDataValue previous); /** * Get a RefDataValue with the given value. A null argument means get * a SQL null value. The second form uses the previous value (if non-null) * to hold the return value. * */ RefDataValue getDataValue(RowLocation value); RefDataValue getDataValue(RowLocation value, RefDataValue previous); /** * Get a SQL int with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * */ NumberDataValue getDataValue(int value); NumberDataValue getDataValue(int value, NumberDataValue previous) throws StandardException; /** * Get a SQL bigint with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * */ NumberDataValue getDataValue(long value); NumberDataValue getDataValue(long value, NumberDataValue previous) throws StandardException; /** * Get a SQL real with the given value. The second form * re-uses the previous value, if non-null, as the data holder to return. * * @exception StandardException Thrown on error */ NumberDataValue getDataValue(float value) throws StandardException; NumberDataValue getDataValue(float value, NumberDataValue previous) throws StandardException; /** * Get a SQL double precision with the given value. The second form * re-uses the previous value, if non-null, as the data holder to return. * * @exception StandardException Thrown on error */ NumberDataValue getDataValue(double value) throws StandardException; NumberDataValue getDataValue(double value, NumberDataValue previous) throws StandardException; /** * Get a SQL SMALLINT with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * */ NumberDataValue getDataValue(short value); NumberDataValue getDataValue(short value, NumberDataValue previous) throws StandardException; /** * Get a SQL TINYINT with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * */ NumberDataValue getDataValue(byte value); NumberDataValue getDataValue(byte value, NumberDataValue previous) throws StandardException; /** * Get a SQL DECIMAL with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * * @exception StandardException Thrown on error */ NumberDataValue getDecimalDataValue(Number value) throws StandardException; NumberDataValue getDecimalDataValue(Number value, NumberDataValue previous) throws StandardException; /** * Get a SQL DECIMAL with the given value. * * @exception StandardException Thrown on error */ NumberDataValue getDecimalDataValue(Long value, NumberDataValue previous) throws StandardException; /** * Get a SQL DECIMAL with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * * @exception StandardException Thrown on error */ NumberDataValue getDecimalDataValue(String value) throws StandardException; NumberDataValue getDecimalDataValue(String value, NumberDataValue previous) throws StandardException; /** * Get a SQL boolean with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * */ BooleanDataValue getDataValue(boolean value); BooleanDataValue getDataValue(boolean value, BooleanDataValue previous) throws StandardException; /** * Get a SQL bit with the given value. The second form re-uses the * previous value, if non-null, as the data holder to return. * * @exception StandardException Thrown on error */ BitDataValue getBitDataValue(byte[] value) throws StandardException; BitDataValue getBitDataValue(byte[] value, BitDataValue previous) throws StandardException;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -