db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r540202 - in /db/derby/code/trunk/java/engine/org/apache/derby: catalog/ iapi/types/
Date Mon, 21 May 2007 16:57:52 GMT
Author: djd
Date: Mon May 21 09:57:50 2007
New Revision: 540202

URL: http://svn.apache.org/viewvc?view=rev&rev=540202
Log:
Minor cleanup in the types packages. Make the collation specific classes package-private as
there is no need to expose the classes outside the package. Cleanup some comments.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/TypeDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollationElementsInterface.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLChar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLClob.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongvarchar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarchar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/TypeDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/TypeDescriptor.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/TypeDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/TypeDescriptor.java Mon May 21
09:57:50 2007
@@ -142,21 +142,29 @@
 
 	/**
 	 * Get the collation type for this type. This api applies only to character
-	 * string types. And it's return value is valid only if the collation 
+	 * string types. And its return value is valid only if the collation 
 	 * derivation  of this type is "implicit" or "explicit". (In Derby 10.3,
 	 * collation derivation can't be "explicit". Hence in Derby 10.3, this api
 	 * should be used only if the collation derivation is "implicit". 
 	 *
 	 * @return	collation type which applies to character string types with
 	 * collation derivation of "implicit" or "explicit". The possible return
-	 * values in Derby 10.3 will be 0(UCS_BASIC) and 1(TERRITORY_BASED). 
+	 * values in Derby 10.3 will be COLLATION_TYPE_UCS_BASIC
+     * and COLLATION_TYPE_TERRITORY_BASED.
+     * 
+     * @see StringDataValue#COLLATION_TYPE_UCS_BASIC
+     * @see StringDataValue#COLLATION_TYPE_TERRITORY_BASED
 	 * 
 	 */
 	public int getCollationType();
 
 	/**
 	 * Set the collation type of this TypeDescriptor
-	 * @param collationTypeValue This will be 0(UCS_BASIC)/1(TERRITORY_BASED)
+	 * @param collationTypeValue This will be COLLATION_TYPE_UCS_BASIC
+     * or COLLATION_TYPE_TERRITORY_BASED
+     * 
+     * @see StringDataValue#COLLATION_TYPE_UCS_BASIC
+     * @see StringDataValue#COLLATION_TYPE_TERRITORY_BASED
 	 */
 	public void setCollationType(int collationTypeValue);
 
@@ -188,17 +196,26 @@
 	 * with character strings with different collations (Section 9.3 Data types 
 	 * of results of aggregations Syntax Rule 3aii).
 	 *  
-	 * Collation derivation will be initialized to 0("none").
+	 * Collation derivation will be initialized to COLLATION_DERIVATION_NONE.
 	 *  
-	 * @return Should be 0("none") or 1("implicit"). 
+	 * @return Should be COLLATION_DERIVATION_NONE or COLLATION_DERIVATION_IMPLICIT
+     * 
+     * @see StringDataValue#COLLATION_DERIVATION_NONE
+     * @see StringDataValue#COLLATION_DERIVATION_IMPLICIT
+     * @see StringDataValue#COLLATION_DERIVATION_EXPLICIT
 	 */
 	public int getCollationDerivation();
 
 	/**
 	 * Set the collation derivation of this DTD
 	 * @param collationDerivationValue This will be 
-	 * (0)none/(1)implicit/(2)explicit
-	 * In Derby 10.3, we do not expect to get value 2(explicit).
+	 * COLLATION_DERIVATION_NONE/COLLATION_DERIVATION_IMPLICIT/COLLATION_DERIVATION_EXPLICIT
+	 * In Derby 10.3, we do not expect to get value COLLATION_DERIVATION_EXPLICIT.
+     * 
+     * @see StringDataValue#COLLATION_DERIVATION_NONE
+     * @see StringDataValue#COLLATION_DERIVATION_IMPLICIT
+     * @see StringDataValue#COLLATION_DERIVATION_EXPLICIT
+
 	 */
 	public void setCollationDerivation(int collationDerivationValue);
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollationElementsInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollationElementsInterface.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollationElementsInterface.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollationElementsInterface.java
Mon May 21 09:57:50 2007
@@ -29,7 +29,7 @@
  * WorkHorseForCollatorDatatypes's collation sensitive methods 
  * "like, stringcompare" etc.  
  */
-public interface CollationElementsInterface
+interface CollationElementsInterface
 {
 	/**
 	 * This method translates the string into a series of collation elements.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLChar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLChar.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLChar.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLChar.java Mon May
21 09:57:50 2007
@@ -40,7 +40,7 @@
  * just passing an appropriate RuleBasedCollator object for that kind of 
  * collation.
  */
-public class CollatorSQLChar extends SQLChar implements CollationElementsInterface
+class CollatorSQLChar extends SQLChar implements CollationElementsInterface
 {
 	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 	/*

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLClob.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLClob.java Mon May
21 09:57:50 2007
@@ -39,7 +39,7 @@
  * just passing an appropriate RuleBasedCollator object for that kind of 
  * collation.
  */
-public class CollatorSQLClob extends SQLClob implements CollationElementsInterface
+class CollatorSQLClob extends SQLClob implements CollationElementsInterface
 {
 	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLLongvarchar.java
Mon May 21 09:57:50 2007
@@ -39,7 +39,7 @@
  * just passing an appropriate RuleBasedCollator object for that kind of 
  * collation.
  */
-public class CollatorSQLLongvarchar extends SQLLongvarchar implements CollationElementsInterface
+class CollatorSQLLongvarchar extends SQLLongvarchar implements CollationElementsInterface
 {
 	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/CollatorSQLVarchar.java Mon
May 21 09:57:50 2007
@@ -39,7 +39,7 @@
  * just passing an appropriate RuleBasedCollator object for that kind of 
  * collation.
  */
-public class CollatorSQLVarchar extends SQLVarchar implements CollationElementsInterface
+class CollatorSQLVarchar extends SQLVarchar implements CollationElementsInterface
 {
 	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLChar.java Mon May 21 09:57:50
2007
@@ -73,15 +73,7 @@
 import java.util.Calendar;
 
 /**
- * SQLChar satisfies the DataValueDescriptor
- * interfaces (i.e., OrderableDataType). It implements an String holder,
- * e.g. for storing a column value; it can be specified
- * when constructed to not allow nulls. Nullability cannot be changed
- * after construction.
- * <p>
- * Because OrderableDataType is a subclass of DataType,
- * SQLChar can play a role in either a DataType/ValueRow
- * or a OrderableDataType/KeyRow, interchangeably.
+ * SQLChar represents a VARCHAR value with UCS_BASIC collation.
  */
 public class SQLChar
 	extends DataType implements StringDataValue, StreamStorable

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java Mon May 21 09:57:50
2007
@@ -41,15 +41,8 @@
 
 
 /**
- * SQLClob uses SQLVarchar by inheritance.
- * It satisfies the DataValueDescriptor interfaces (i.e., OrderableDataType). It implements
a String
- * holder, e.g. for storing a column value; it can be specified
- * when constructed to not allow nulls. Nullability cannot be changed
- * after construction.
- * <p>
- * Because OrderableDataType is a subclass of DataType,
- * SQLLongvarchar can play a role in either a DataType/ValueRow
- * or a OrderableDataType/KeyRow, interchangeably.
+ * SQLClob represents a CLOB value with UCS_BASIC collation.
+ * CLOB supports LIKE operator only for collation.
  */
 public class SQLClob
 	extends SQLVarchar

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java Mon May 21
09:57:50 2007
@@ -49,23 +49,7 @@
 import java.sql.SQLException;
 
 /**
- * SQLInteger satisfies the DataValueDescriptor
- * interfaces (i.e., OrderableDataType). It implements an integer column, 
- * e.g. for * storing a column value; it can be specified
- * when constructed to not allow nulls. Nullability cannot be changed
- * after construction, as it affects the storage size and mechanism.
- * <p>
- * Because OrderableDataType is a subtype of DataType,
- * SQLInteger can play a role in either a DataType/Row
- * or a OrderableDataType/Row, interchangeably.
- * <p>
- * We assume the store has a flag for nullness of the value,
- * and simply return a 0-length array for the stored form
- * when the value is null.
- * <p>
- * PERFORMANCE: There are likely alot of performance improvements
- * possible for this implementation -- it new's Integer
- * more than it probably wants to.
+ * SQLInteger represents an INTEGER value.
  */
 public final class SQLInteger
 	extends NumberDataType

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongvarchar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongvarchar.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongvarchar.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongvarchar.java Mon May
21 09:57:50 2007
@@ -38,14 +38,7 @@
 import org.apache.derby.iapi.util.StringUtil;
 
 /**
- * SQLLongvarchar satisfies the DataValueDescriptor interfaces (i.e., OrderableDataType).
It implements a String
- * holder, e.g. for storing a column value; it can be specified
- * when constructed to not allow nulls. Nullability cannot be changed
- * after construction.
- * <p>
- * Because OrderableDataType is a subclass of DataType,
- * SQLLongvarchar can play a role in either a DataType/ValueRow
- * or a OrderableDataType/KeyRow, interchangeably.
+ * SQLLongvarchar represents a LONG VARCHAR value with UCS_BASIC collation.
  *
  * SQLLongvarchar is mostly the same as SQLVarchar, so it is implemented as a
  * subclass of SQLVarchar.  Only those methods with different behavior are

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarchar.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarchar.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarchar.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarchar.java Mon May 21
09:57:50 2007
@@ -38,15 +38,7 @@
 import org.apache.derby.iapi.util.StringUtil;
 
 /**
- * SQLVarchar satisfies the DataValueDescriptor
- * interfaces (i.e., OrderableDataType). It implements a String holder, 
- * e.g. for storing a column value; it can be specified
- * when constructed to not allow nulls. Nullability cannot be changed
- * after construction.
- * <p>
- * Because OrderableDataType is a subclass of DataType,
- * SQLVarchar can play a role in either a DataType/ValueRow
- * or a OrderableDataType/KeyRow, interchangeably.
+ * SQLVarchar represents a VARCHAR value with UCS_BASIC collation.
  *
  * SQLVarchar is mostly the same as SQLChar, so it is implemented as a
  * subclass of SQLChar.  Only those methods with different behavior are

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java?view=diff&rev=540202&r1=540201&r2=540202
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/WorkHorseForCollatorDatatypes.java
Mon May 21 09:57:50 2007
@@ -25,7 +25,6 @@
 import org.apache.derby.iapi.types.BooleanDataValue;
 
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.services.io.StoredFormatIds;
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -44,20 +43,20 @@
  * the code for collation sensitive methods. Instead, they can simply delegate
  * the work to methods defined in this class. 
  */
-public class WorkHorseForCollatorDatatypes  
+final class WorkHorseForCollatorDatatypes  
 {
 	/** 
 	 * Use this object for collation on character datatype. This collator
 	 * object is passed as a parameter to the constructor.
 	 */
-	RuleBasedCollator collatorForCharacterDatatypes;
+	private RuleBasedCollator collatorForCharacterDatatypes;
 	/**
 	 * collatorForCharacterDatatypes will be used on this SQLChar to determine
 	 * collationElementsForString. The collationElementsForString is used by
 	 * the like method to do Collator specific comparison.
 	 * This SQLChar object is passed as a parameter to the constructor.
 	 */
-	SQLChar stringData;
+	private SQLChar stringData;
 	/**
 	 * Following is the array holding a series of collation elements for the
 	 * string. It will be used in the like method. This gets initialized when
@@ -74,7 +73,7 @@
 	// For null strings, cKey = null.
 	private CollationKey cKey; 
 
-	public WorkHorseForCollatorDatatypes(
+	WorkHorseForCollatorDatatypes(
 			RuleBasedCollator collatorForCharacterDatatypes,
 			SQLChar stringData)
 	{
@@ -83,7 +82,7 @@
 	}
 	
 	/** @see SQLChar#stringCompare(SQLChar, SQLChar) */
-	protected int stringCompare(SQLChar str1, SQLChar str2)
+	int stringCompare(SQLChar str1, SQLChar str2)
 	throws StandardException
 	{
 		CollationKey ckey1 = str1.getCollationKey();
@@ -117,7 +116,7 @@
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public BooleanDataValue like(DataValueDescriptor pattern)
+	BooleanDataValue like(DataValueDescriptor pattern)
 								throws StandardException
 	{
 		Boolean likeResult;
@@ -149,7 +148,7 @@
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public BooleanDataValue like(DataValueDescriptor pattern, 
+	BooleanDataValue like(DataValueDescriptor pattern, 
 			DataValueDescriptor escape)	throws StandardException
 	{
 		Boolean likeResult;
@@ -197,7 +196,7 @@
 	 * Get the RuleBasedCollator which is getting used for collation sensitive
 	 * methods. 
 	 */
-	protected RuleBasedCollator getCollatorForCollation()
+	RuleBasedCollator getCollatorForCollation()
 	{
 		return(collatorForCharacterDatatypes);
 	}
@@ -210,7 +209,7 @@
 	 *
 	 * @return count of collation elements for this instance of CollatorSQLChar
 	 */
-	protected int getCountOfCollationElements()
+	int getCountOfCollationElements()
 	{
 		return countOfCollationElements;
 	}
@@ -222,7 +221,7 @@
 	 * @return an array of collation elements for the string
 	 * @throws StandardException
 	 */
-	protected int[] getCollationElementsForString()
+	int[] getCollationElementsForString()
 		throws StandardException
 	{
 		if (stringData.isNull())



Mime
View raw message