directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r190832 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SubstringFilter.java
Date Wed, 15 Jun 2005 23:30:42 GMT
Author: elecharny
Date: Wed Jun 15 16:30:42 2005
New Revision: 190832

URL: http://svn.apache.org/viewcvs?rev=190832&view=rev
Log:
- Changed LDAPString to MutableString
- The class now extends Filter
- Added some javadoc
- added a constructor
- added a member to control the length

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SubstringFilter.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SubstringFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SubstringFilter.java?rev=190832&r1=190831&r2=190832&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SubstringFilter.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SubstringFilter.java
Wed Jun 15 16:30:42 2005
@@ -16,7 +16,10 @@
  */
 package org.apache.asn1.ldap.pojo;
 
-import org.apache.asn1.ldap.codec.primitives.LdapString;
+import java.util.ArrayList;
+
+import org.apache.asn1.ldap.pojo.filters.Filter;
+import org.apache.asn1.util.MutableString;
 
 
 /**
@@ -28,101 +31,128 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SubstringFilter
+public class SubstringFilter extends Filter
 {
     //~ Instance fields ----------------------------------------------------------------------------
 
     /** The substring filter type (an attributeDescription) */
-    private LdapString type;
+    private MutableString type;
 
+    /** This member is used to control the length of the three parts of the substring filter
**/
+    private transient int substringsLength;
+    
     /** The initial filter */
-    private LdapString initialSubStrings;
+    private MutableString initialSubstrings;
 
-    /** The any filter */
-    private LdapString anySubStrings;
+    /** The any filter. It's a list of LdapString */
+    private ArrayList anySubstrings;
 
     /** The final filter */
-    private LdapString finalSubStrings;
+    private MutableString finalSubstrings;
 
     //~ Methods ------------------------------------------------------------------------------------
+    
+    /**
+     * The constructor. We will create the 'any' subsring arraylist with only one element.
+     */
+    public SubstringFilter()
+    {
+        anySubstrings = new ArrayList(1);
+    }
 
     /**
-     * DOCUMENT ME!
+     * Get the internal substrings
      *
-     * @return Returns the anySubStrings.
+     * @return Returns the anySubstrings.
      */
-    public LdapString getAnySubStrings()
+    public ArrayList getAnySubstrings()
     {
-        return anySubStrings;
+        return anySubstrings;
     }
 
     /**
-     * DOCUMENT ME!
+     * Add a internal substring
      *
-     * @param anySubStrings The anySubStrings to set.
+     * @param anySubstrings The anySubstrings to set.
      */
-    public void setAnySubStrings( LdapString anySubStrings )
+    public void addAnySubstrings( MutableString anySubstrings )
     {
-        this.anySubStrings = anySubStrings;
+        this.anySubstrings.add(anySubstrings);
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the final substring
      *
-     * @return Returns the finalSubStrings.
+     * @return Returns the finalSubstrings.
      */
-    public LdapString getFinalSubStrings()
+    public MutableString getFinalSubstrings()
     {
-        return finalSubStrings;
+        return finalSubstrings;
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the final substring
      *
-     * @param finalSubStrings The finalSubStrings to set.
+     * @param finalSubstrings The finalSubstrings to set.
      */
-    public void setFinalSubStrings( LdapString finalSubStrings )
+    public void setFinalSubstrings( MutableString finalSubstrings )
     {
-        this.finalSubStrings = finalSubStrings;
+        this.finalSubstrings = finalSubstrings;
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the initial substring
      *
-     * @return Returns the initialSubStrings.
+     * @return Returns the initialSubstrings.
      */
-    public LdapString getInitialSubStrings()
+    public MutableString getInitialSubstrings()
     {
-        return initialSubStrings;
+        return initialSubstrings;
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the initial substring
      *
-     * @param initialSubStrings The initialSubStrings to set.
+     * @param initialSubstrings The initialSubstrings to set.
      */
-    public void setInitialSubStrings( LdapString initialSubStrings )
+    public void setInitialSubstrings( MutableString initialSubstrings )
     {
-        this.initialSubStrings = initialSubStrings;
+        this.initialSubstrings = initialSubstrings;
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the attribute
      *
      * @return Returns the type.
      */
-    public LdapString getType()
+    public MutableString getType()
     {
         return type;
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the attribute to match
      *
      * @param type The type to set.
      */
-    public void setType( LdapString type )
+    public void setType( MutableString type )
     {
         this.type = type;
+    }
+    
+    /**
+     * @return Returns the substringsLength.
+     */
+    public int getSubstringsLength() 
+    {
+        return substringsLength;
+    }
+    
+    /**
+     * @param substringsLength The substringsLength to set.
+     */
+    public void setSubstringsLength(int substringsLength) 
+    {
+        this.substringsLength = substringsLength;
     }
 }



Mime
View raw message