db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r540971 - in /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types: CollatorSQLChar.java CollatorSQLClob.java CollatorSQLLongvarchar.java CollatorSQLVarchar.java SQLChar.java SQLClob.java SQLLongvarchar.java SQLVarchar.java
Date Wed, 23 May 2007 15:07:33 GMT
Author: djd
Date: Wed May 23 08:07:32 2007
New Revision: 540971

URL: http://svn.apache.org/viewvc?view=rev&rev=540971
Log:
Minor cleanup in the collator character types to ensure that a collator DVD is always
created with collation information and share setup code for setting its collator
by having the constructors call the setCollator() method.

Modified:
    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/SQLLongvarchar.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLVarchar.java

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed May
23 08:07:32 2007
@@ -42,30 +42,34 @@
  */
 class CollatorSQLChar extends SQLChar implements CollationElementsInterface
 {
-	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
+	private WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 	/*
 	 * constructors
 	 */
-
-	/**
-		no-arg constructor, required by Formattable.
-	*/
-	public CollatorSQLChar()
-	{
-	}
-
-	public CollatorSQLChar(String val, RuleBasedCollator collatorForCharacterDatatypes)
+    /**
+     * Create SQL CHAR value initially set to NULL that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+    CollatorSQLChar(RuleBasedCollator collatorForCharacterDatatypes)
+    {
+        setCollator(collatorForCharacterDatatypes);
+    }
+    
+    /**
+     * Create SQL CHAR value initially set to value that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+	CollatorSQLChar(String val, RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		super(val);
-		holderForCollationSensitiveInfo = 
-			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
+        setCollator(collatorForCharacterDatatypes);
 	}
 
 	/**
 	 * Set the RuleBasedCollator for this instance of CollatorSQLChar. It will
 	 * be used to do the collation.
 	 */
-	protected void setCollator(RuleBasedCollator collatorForCharacterDatatypes)
+	private void setCollator(RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		holderForCollationSensitiveInfo = 
 			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
@@ -110,8 +114,7 @@
 	 */
 	public DataValueDescriptor getNewNull()
 	{
-		CollatorSQLChar result = new CollatorSQLChar();
-		result.setCollator(
+		CollatorSQLChar result = new CollatorSQLChar(
 				holderForCollationSensitiveInfo.getCollatorForCollation());
 		return result;
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed May
23 08:07:32 2007
@@ -41,31 +41,36 @@
  */
 class CollatorSQLClob extends SQLClob implements CollationElementsInterface
 {
-	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
+	private WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 
 	/*
 	 * constructors
 	 */
-
-	/**
-		no-arg constructor, required by Formattable.
-	*/
-	public CollatorSQLClob()
-	{
-	}
-
-	public CollatorSQLClob(String val, RuleBasedCollator collatorForCharacterDatatypes)
+    
+    /**
+     * Create SQL CLOB value initially set to NULL that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+    CollatorSQLClob(RuleBasedCollator collatorForCharacterDatatypes)
+    {
+        setCollator(collatorForCharacterDatatypes);
+    }
+    
+    /**
+     * Create SQL CLOB value initially set to value that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+	CollatorSQLClob(String val, RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		super(val);
-		holderForCollationSensitiveInfo = 
-			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
+        setCollator(collatorForCharacterDatatypes);
 	}
 
 	/**
 	 * Set the RuleBasedCollator for this instance of CollatorSQLClob. It will
 	 * be used to do the collation.
 	 */
-	protected void setCollator(RuleBasedCollator collatorForCharacterDatatypes)
+	private void setCollator(RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		holderForCollationSensitiveInfo = 
 			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
@@ -110,8 +115,7 @@
 	 */
 	public DataValueDescriptor getNewNull()
 	{
-		CollatorSQLClob result = new CollatorSQLClob();
-		result.setCollator(
+		CollatorSQLClob result = new CollatorSQLClob(null,
 				holderForCollationSensitiveInfo.getCollatorForCollation());
 		return result;
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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
Wed May 23 08:07:32 2007
@@ -41,24 +41,30 @@
  */
 class CollatorSQLLongvarchar extends SQLLongvarchar implements CollationElementsInterface
 {
-	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
+	private WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 
 	/*
 	 * constructors
 	 */
 
-	/**
-		no-arg constructor, required by Formattable.
-	*/
-	public CollatorSQLLongvarchar()
-	{
-	}
 
-	public CollatorSQLLongvarchar(String val, RuleBasedCollator collatorForCharacterDatatypes)
+    /**
+     * Create SQL LONG VARCHAR value initially set to NULL that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+	CollatorSQLLongvarchar(RuleBasedCollator collatorForCharacterDatatypes)
+	{
+        setCollator(collatorForCharacterDatatypes);
+	}
+    
+    /**
+     * Create SQL LONG VARCHAR value initially set to value that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+	CollatorSQLLongvarchar(String val, RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		super(val);
-		holderForCollationSensitiveInfo = 
-			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
+		setCollator(collatorForCharacterDatatypes);
 	}
 
 	/**
@@ -110,8 +116,7 @@
 	 */
 	public DataValueDescriptor getNewNull()
 	{
-		CollatorSQLLongvarchar result = new CollatorSQLLongvarchar();
-		result.setCollator(
+		CollatorSQLLongvarchar result = new CollatorSQLLongvarchar(
 				holderForCollationSensitiveInfo.getCollatorForCollation());
 		return result;
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed
May 23 08:07:32 2007
@@ -41,31 +41,36 @@
  */
 class CollatorSQLVarchar extends SQLVarchar implements CollationElementsInterface
 {
-	WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
+	private WorkHorseForCollatorDatatypes holderForCollationSensitiveInfo;
 
 	/*
 	 * constructors
 	 */
-
-	/**
-		no-arg constructor, required by Formattable.
-	*/
-	public CollatorSQLVarchar()
-	{
-	}
-
-	public CollatorSQLVarchar(String val, RuleBasedCollator collatorForCharacterDatatypes)
+    
+    /**
+     * Create SQL VARCHAR value initially set to NULL that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+    CollatorSQLVarchar(RuleBasedCollator collatorForCharacterDatatypes)
+    {
+        setCollator(collatorForCharacterDatatypes);
+    }
+    
+    /**
+     * Create SQL VARCHAR value initially set to value that
+     * performs collation according to collatorForCharacterDatatypes 
+     */
+	CollatorSQLVarchar(String val, RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		super(val);
-		holderForCollationSensitiveInfo = 
-			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
+        setCollator(collatorForCharacterDatatypes);
 	}
 
 	/**
 	 * Set the RuleBasedCollator for this instance of CollatorSQLVarchar. It will
 	 * be used to do the collation.
 	 */
-	protected void setCollator(RuleBasedCollator collatorForCharacterDatatypes)
+	private void setCollator(RuleBasedCollator collatorForCharacterDatatypes)
 	{
 		holderForCollationSensitiveInfo = 
 			new WorkHorseForCollatorDatatypes(collatorForCharacterDatatypes, this);
@@ -110,8 +115,7 @@
 	 */
 	public DataValueDescriptor getNewNull()
 	{
-		CollatorSQLVarchar result = new CollatorSQLVarchar();
-		result.setCollator(
+		CollatorSQLVarchar result = new CollatorSQLVarchar(
 				holderForCollationSensitiveInfo.getCollatorForCollation());
 		return result;
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed May 23 08:07:32
2007
@@ -957,9 +957,8 @@
 		} else {
 			//non-null collatorForComparison means use collator sensitive
 			//implementation of SQLChar
-		     CollatorSQLChar s = new CollatorSQLChar();
+		     CollatorSQLChar s = new CollatorSQLChar(collatorForComparison);
 		     s.copyState(this);
-		     s.setCollator(collatorForComparison);
 		     return s;
 		}
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed May 23 08:07:32
2007
@@ -97,9 +97,8 @@
 		} else {
 			//non-null collatorForComparison means use collator sensitive
 			//implementation of SQLClob
-		     CollatorSQLClob s = new CollatorSQLClob();
+		     CollatorSQLClob s = new CollatorSQLClob(collatorForComparison);
 		     s.copyState(this);
-		     s.setCollator(collatorForComparison);
 		     return s;
 		}
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed May
23 08:07:32 2007
@@ -97,9 +97,8 @@
 		} else {
 			//non-null collatorForComparison means use collator sensitive
 			//implementation of SQLLongvarchar
-		     CollatorSQLLongvarchar s = new CollatorSQLLongvarchar();
+		     CollatorSQLLongvarchar s = new CollatorSQLLongvarchar(collatorForComparison);
 		     s.copyState(this);
-		     s.setCollator(collatorForComparison);
 		     return s;
 		}
 	}

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=540971&r1=540970&r2=540971
==============================================================================
--- 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 Wed May 23
08:07:32 2007
@@ -95,9 +95,8 @@
 		} else {
 			//non-null collatorForComparison means use collator sensitive
 			//implementation of SQLVarchar
-		     CollatorSQLVarchar s = new CollatorSQLVarchar();
+		     CollatorSQLVarchar s = new CollatorSQLVarchar(collatorForComparison);
 		     s.copyState(this);
-		     s.setCollator(collatorForComparison);
 		     return s;
 		}
 	}



Mime
View raw message