directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r359024 - /directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/
Date Mon, 26 Dec 2005 00:35:41 GMT
Author: elecharny
Date: Sun Dec 25 16:35:30 2005
New Revision: 359024

URL: http://svn.apache.org/viewcvs?rev=359024&view=rev
Log:
Added a toString() method

Modified:
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/CachingNormalizer.java
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ComparableComparator.java
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimNormalizer.java
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/NoOpNormalizer.java
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierNormalizer.java
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/CachingNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/CachingNormalizer.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/CachingNormalizer.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/CachingNormalizer.java
Sun Dec 25 16:35:30 2005
@@ -35,6 +35,7 @@
     
     /** Least recently used cache */
     private final SynchronizedLRUMap cache ;
+    
     /** The underlying decorated Normalizer */
     private final Normalizer normalizer;
 
@@ -90,5 +91,28 @@
         Object normalized = normalizer.normalize( value ) ;
         cache.put( value, normalized ) ;
         return normalized ;
+    }
+    
+    /**
+     * A String representation of this normalizer
+     */
+    public String toString()
+    {
+    	StringBuffer sb = new StringBuffer();
+    	
+    	sb.append( "CachingNormalizer : " );
+    	
+    	if ( ( cache != null ) && ( cache.size() != 0 ) )
+    	{
+        	sb.append( "Cache size = " ).append( cache.size() );
+    	}
+    	else
+    	{
+    		sb.append ( "Cache size = 0" );
+    	}
+    	
+    	sb.append( ", Normalizer : " ).append( normalizer );
+    	
+    	return sb.toString();
     }
 }

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ComparableComparator.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ComparableComparator.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ComparableComparator.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ComparableComparator.java
Sun Dec 25 16:35:30 2005
@@ -55,4 +55,13 @@
 
         return o1.hashCode() - o2.hashCode();
     }
+    
+    /**
+     * A String representation of this class
+     */
+    public String toString()
+    {
+    	return "Comparable comparator";
+    }
+    
 }

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimNormalizer.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimNormalizer.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimNormalizer.java
Sun Dec 25 16:35:30 2005
@@ -49,4 +49,12 @@
             return StringTools.deepTrim( (String)value );
         }
     }
+    
+    /**
+     * A String representation of this normalizer
+     */
+    public String toString()
+    {
+    	return "DeepTrimNormalizer";
+    }
 }

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
Sun Dec 25 16:35:30 2005
@@ -50,4 +50,12 @@
             return StringTools.deepTrimToLower( (String)value );
         }
     }
+    
+    /**
+     * A String representation of this normalizer
+     */
+    public String toString()
+    {
+    	return "DeepTrimToLowerNormalizer";
+    }
 }

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/NoOpNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/NoOpNormalizer.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/NoOpNormalizer.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/NoOpNormalizer.java
Sun Dec 25 16:35:30 2005
@@ -30,7 +30,6 @@
 {
     static final long serialVersionUID = -7817763636668562489L;
 
-
     /**
      * Creates a do nothing normalizer.
      */
@@ -49,5 +48,13 @@
     public Object normalize( Object value )
     {
         return value ;
+    }
+    
+    /**
+     * Return the representation of this normalizer : its name.
+     */
+    public String toString()
+    {
+    	return "NoOpNormalizer";
     }
 }

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierNormalizer.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierNormalizer.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierNormalizer.java
Sun Dec 25 16:35:30 2005
@@ -56,4 +56,12 @@
             return str.toLowerCase();
         }
     }
+    
+    /**
+     * A String representation of this normalizer
+     */
+    public String toString()
+    {
+    	return "ObjectIndentifierNormalizer";
+    }
 }

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java?rev=359024&r1=359023&r2=359024&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/RegexNormalizer.java
Sun Dec 25 16:35:30 2005
@@ -79,19 +79,15 @@
     public String toString()
     {
         StringBuffer buf = new StringBuffer() ;
-        buf.append( "RegexNormalizer( " ) ;
+        buf.append( "RegexNormalizer : {\n" ) ;
 
-        for ( int ii = 0; ii < regexes.length; ii++ )
+        for ( int i = 0; i < regexes.length; i++ )
         {
-            buf.append( regexes[ii] );
-
-            if ( ii < regexes.length - 1 )
-            {
-                buf.append( ", " );
-            }
+            buf.append( "  ").append( regexes[i] ).append( '\n' );
         }
 
-        buf.append( " )" ) ;
+        buf.append( "}\n" ) ;
+        
         return buf.toString() ;
     }
 }



Mime
View raw message