--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.types.BooleanDataValue\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to you under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.types;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+public interface BooleanDataValue extends DataValueDescriptor\r
+{\r
+ public boolean getBoolean();\r
+\r
+ /**\r
+ * The SQL AND operator. This provides SQL semantics for AND with unknown\r
+ * truth values - consult any standard SQL reference for an explanation.\r
+ *\r
+ * @param otherValue The other BooleanDataValue to AND with this one\r
+ *\r
+ * @return this AND otherValue\r
+ *\r
+ */\r
+ public BooleanDataValue and(BooleanDataValue otherValue);\r
+\r
+ /**\r
+ * The SQL OR operator. This provides SQL semantics for OR with unknown\r
+ * truth values - consult any standard SQL reference for an explanation.\r
+ *\r
+ * @param otherValue The other BooleanDataValue to OR with this one\r
+ *\r
+ * @return this OR otherValue\r
+ *\r
+ */\r
+ public BooleanDataValue or(BooleanDataValue otherValue);\r
+\r
+ /**\r
+ * The SQL IS operator - consult any standard SQL reference for an explanation.\r
+ *\r
+ * Implements the following truth table:\r
+ *\r
+ * otherValue\r
+ * | TRUE | FALSE | UNKNOWN\r
+ * this |----------------------------\r
+ * |\r
+ * TRUE | TRUE | FALSE | FALSE\r
+ * FALSE | FALSE | TRUE | FALSE\r
+ * UNKNOWN | FALSE | FALSE | TRUE\r
+ *\r
+ *\r
+ * @param otherValue BooleanDataValue to compare to. May be TRUE, FALSE, or UNKNOWN.\r
+ *\r
+ * @return whether this IS otherValue\r
+ *\r
+ */\r
+ public BooleanDataValue is(BooleanDataValue otherValue);\r
+\r
+ /**\r
+ * Implements NOT IS. This reverses the sense of the is() call.\r
+ *\r
+ *\r
+ * @param otherValue BooleanDataValue to compare to. May be TRUE, FALSE, or UNKNOWN.\r
+ *\r
+ * @return NOT( this IS otherValue )\r
+ *\r
+ */\r
+ public BooleanDataValue isNot(BooleanDataValue otherValue);\r
+\r
+ /**\r
+ * Throw an exception with the given SQLState if this BooleanDataValue\r
+ * is false. This method is useful for evaluating constraints.\r
+ *\r
+ * @param SQLState The SQLState of the exception to throw if\r
+ * this SQLBoolean is false.\r
+ * @param tableName The name of the table to include in the exception\r
+ * message.\r
+ * @param constraintName The name of the failed constraint to include\r
+ * in the exception message.\r
+ *\r
+ * @return this\r
+ *\r
+ * @exception StandardException Thrown if this BooleanDataValue\r
+ * is false.\r
+ */\r
+ public BooleanDataValue throwExceptionIfFalse(\r
+ String SQLState,\r
+ String tableName,\r
+ String constraintName)\r
+ throws StandardException;\r
+\r
+ /*\r
+ ** NOTE: The NOT operator is translated to "= FALSE", which does the same\r
+ ** thing.\r
+ */\r
+\r
+ /**\r
+ * Set the value of this BooleanDataValue.\r
+ *\r
+ * @param theValue Contains the boolean value to set this BooleanDataValue\r
+ * to. Null means set this BooleanDataValue to null.\r
+ */\r
+ public void setValue(Boolean theValue);\r
+\r
+ /**\r
+ * Tell whether a BooleanDataValue has the given value. This is useful\r
+ * for short-circuiting.\r
+ *\r
+ * @param value The value to look for\r
+ *\r
+ * @return true if the BooleanDataValue contains the given value.\r
+ */\r
+ public boolean equals(boolean value);\r
+ \r
+ /**\r
+ * Return an immutable BooleanDataValue with the same value as this.\r
+ * @return An immutable BooleanDataValue with the same value as this.\r
+ */\r
+ public BooleanDataValue getImmutable();\r
+}\r