directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r556416 - /directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/
Date Sun, 15 Jul 2007 15:30:59 GMT
Author: seelmann
Date: Sun Jul 15 08:30:57 2007
New Revision: 556416

URL: http://svn.apache.org/viewvc?view=rev&rev=556416
Log:
Cleanup an Javadoc.

Modified:
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilter.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterComponent.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterExtensibleComponent.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterItemComponent.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapNotFilterComponent.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java
Sun Jul 15 08:30:57 2007
@@ -26,15 +26,29 @@
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
+/**
+ * The LdapAndFilterComponent represents an AND filter branch.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class LdapAndFilterComponent extends LdapFilterComponent
 {
 
+    /**
+     * Creates a new instance of LdapAndFilterComponent.
+     * 
+     * @param parent the parent filter
+     */
     public LdapAndFilterComponent( LdapFilter parent )
     {
         super( parent );
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#setStartToken(org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken)
+     */
     public boolean setStartToken( LdapFilterToken andToken )
     {
         if ( andToken != null && andToken.getType() == LdapFilterToken.AND )
@@ -48,13 +62,16 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getInvalidCause()
+     */
     public String getInvalidCause()
     {
-        if ( this.startToken == null )
+        if ( startToken == null )
         {
             return "Missing AND character '&'";
         }
-        else if ( this.filterList == null || this.filterList.isEmpty() )
+        else if ( filterList == null || filterList.isEmpty() )
         {
             return "Missing filters";
         }
@@ -65,9 +82,12 @@
     }
 
 
+    /**
+     * @see java.lang.Object#toString()
+     */
     public String toString()
     {
-        String s = this.startToken != null ? "&" : "";
+        String s = startToken != null ? "&" : "";
         for ( Iterator it = filterList.iterator(); it.hasNext(); )
         {
             LdapFilter filter = ( LdapFilter ) it.next();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilter.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilter.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilter.java
Sun Jul 15 08:30:57 2007
@@ -29,6 +29,12 @@
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
+/**
+ * The LdapFilter class represents an LDAP filter.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class LdapFilter
 {
 
@@ -38,18 +44,28 @@
 
     private LdapFilterToken stopToken;
 
-    private List otherTokens;
+    private List<LdapFilterToken> otherTokens;
 
 
+    /**
+     * Creates a new instance of LdapFilter.
+     */
     public LdapFilter()
     {
         this.startToken = null;
         this.filterComponent = null;
         this.stopToken = null;
-        this.otherTokens = new ArrayList( 2 );
+        this.otherTokens = new ArrayList<LdapFilterToken>( 2 );
     }
 
 
+    /**
+     * Sets the start token.
+     * 
+     * @param startToken the start token
+     * 
+     * @return true, if setting the start token was successful, false otherwise
+     */
     public boolean setStartToken( LdapFilterToken startToken )
     {
         if ( this.startToken == null && startToken != null && startToken.getType()
== LdapFilterToken.LPAR )
@@ -64,6 +80,13 @@
     }
 
 
+    /**
+     * Sets the filter component.
+     * 
+     * @param filterComponent the filter component
+     * 
+     * @return true, if setting the filter component was successful, false otherwise
+     */
     public boolean setFilterComponent( LdapFilterComponent filterComponent )
     {
         if ( this.startToken != null && this.filterComponent == null && filterComponent
!= null )
@@ -78,6 +101,13 @@
     }
 
 
+    /**
+     * Sets the stop token.
+     * 
+     * @param stopToken the stop token
+     * 
+     * @return true, if setting the stop token was successful, false otherwise
+     */
     public boolean setStopToken( LdapFilterToken stopToken )
     {
         if ( this.startToken != null && this.stopToken == null && stopToken
!= null
@@ -93,51 +123,75 @@
     }
 
 
+    /**
+     * Adds another token.
+     * 
+     * @param otherToken the other token
+     */
     public void addOtherToken( LdapFilterToken otherToken )
     {
-        this.otherTokens.add( otherToken );
+        otherTokens.add( otherToken );
     }
 
 
+    /**
+     * Gets the start token.
+     * 
+     * @return the start token, or null if not set
+     */
     public LdapFilterToken getStartToken()
     {
-        return this.startToken;
+        return startToken;
     }
 
 
+    /**
+     * Gets the filter component.
+     * 
+     * @return the filter component, or null if not set
+     */
     public LdapFilterComponent getFilterComponent()
     {
-        return this.filterComponent;
+        return filterComponent;
     }
 
 
+    /**
+     * Gets the stop token.
+     * 
+     * @return the stop token or null if not set
+     */
     public LdapFilterToken getStopToken()
     {
-        return this.stopToken;
+        return stopToken;
     }
 
 
+    /**
+     * Gets all the tokens.
+     * 
+     * @return the tokens
+     */
     public LdapFilterToken[] getTokens()
     {
-
         // collect tokens
-        List tokenList = new ArrayList();
-        if ( this.startToken != null )
+        List<LdapFilterToken> tokenList = new ArrayList<LdapFilterToken>();
+        if ( startToken != null )
         {
-            tokenList.add( this.startToken );
+            tokenList.add( startToken );
         }
-        if ( this.stopToken != null )
+        if ( stopToken != null )
         {
-            tokenList.add( this.stopToken );
+            tokenList.add( stopToken );
         }
-        if ( this.filterComponent != null )
+        if ( filterComponent != null )
         {
-            tokenList.addAll( Arrays.asList( this.filterComponent.getTokens() ) );
+            tokenList.addAll( Arrays.asList( filterComponent.getTokens() ) );
         }
-        tokenList.addAll( this.otherTokens );
+        tokenList.addAll( otherTokens );
 
         // sort tokens
-        LdapFilterToken[] tokens = ( LdapFilterToken[] ) tokenList.toArray( new LdapFilterToken[tokenList.size()]
);
+        LdapFilterToken[] tokens = tokenList.toArray( new LdapFilterToken[tokenList.size()]
);
         Arrays.sort( tokens );
 
         // return
@@ -145,43 +199,62 @@
     }
 
 
+    /**
+     * Checks if this filter and all its subfilters are valid.
+     * 
+     * @return true, if this filter and all its subfilters is valid
+     */
     public boolean isValid()
     {
-        return this.startToken != null && this.filterComponent != null &&
this.filterComponent.isValid()
-            && this.stopToken != null;
+        return startToken != null && filterComponent != null && filterComponent.isValid()
&& stopToken != null;
     }
 
 
+    /**
+     * Gets the invalid filters. This may be this filter itself or any of the subfilters.
+     * 
+     * @return an array of invalid filters or an empty array if all subfilters
+     *         are valid.
+     */
     public LdapFilter[] getInvalidFilters()
     {
-        if ( this.startToken == null || this.filterComponent == null || this.stopToken ==
null )
+        if ( startToken == null || filterComponent == null || stopToken == null )
         {
             return new LdapFilter[]
                 { this };
         }
         else
         {
-            return this.filterComponent.getInvalidFilters();
+            return filterComponent.getInvalidFilters();
         }
     }
 
 
+    /**
+     * Gets the filter at the given offset. This may be this filter
+     * or one of the subfilters.
+     * 
+     * @param offset the offset
+     * 
+     * @return the filter at the given offset or null is offset is out of
+     *         range.
+     */
     public LdapFilter getFilter( int offset )
     {
-        if ( this.startToken != null && this.startToken.getOffset() == offset )
+        if ( startToken != null && startToken.getOffset() == offset )
         {
             return this;
         }
-        else if ( this.stopToken != null && this.stopToken.getOffset() == offset
)
+        else if ( stopToken != null && stopToken.getOffset() == offset )
         {
             return this;
         }
 
-        if ( this.otherTokens != null && this.otherTokens.size() > 0 )
+        if ( otherTokens != null && otherTokens.size() > 0 )
         {
-            for ( int i = 0; i < this.otherTokens.size(); i++ )
+            for ( int i = 0; i < otherTokens.size(); i++ )
             {
-                LdapFilterToken otherToken = ( LdapFilterToken ) this.otherTokens.get( i
);
+                LdapFilterToken otherToken = otherTokens.get( i );
                 if ( otherToken != null && otherToken.getOffset() <= offset
                     && offset < otherToken.getOffset() + otherToken.getLength()
)
                 {
@@ -190,35 +263,43 @@
             }
         }
 
-        if ( this.filterComponent != null )
+        if ( filterComponent != null )
         {
-            return this.filterComponent.getFilter( offset );
+            return filterComponent.getFilter( offset );
         }
 
         return this;
     }
 
 
+    /**
+     * Gets the invalid cause.
+     * 
+     * @return the invalid cause, or null if this filter is valid.
+     */
     public String getInvalidCause()
     {
-        if ( this.stopToken == null )
+        if ( stopToken == null )
         {
             return BrowserCoreMessages.model_filter_missing_closing_parenthesis;
         }
-        else if ( this.filterComponent == null )
+        else if ( filterComponent == null )
         {
             return BrowserCoreMessages.model_filter_missing_filter_expression;
         }
         else
         {
-            return this.filterComponent.getInvalidCause();
+            return filterComponent.getInvalidCause();
         }
     }
 
 
+    /**
+     * @see java.lang.Object#toString()
+     */
     public String toString()
     {
-        return ( this.startToken != null ? "(" : "" ) + ( filterComponent != null ? filterComponent.toString()
: "" ) + ( this.stopToken != null ? ")" : "" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$ //$NON-NLS-5$
+        return ( startToken != null ? "(" : "" ) + ( filterComponent != null ? filterComponent.toString()
: "" ) + ( stopToken != null ? ")" : "" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
//$NON-NLS-5$
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterComponent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterComponent.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterComponent.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterComponent.java
Sun Jul 15 08:30:57 2007
@@ -29,30 +29,40 @@
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
+/**
+ * The LdapFilterComponent is the base class for all filter components.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public abstract class LdapFilterComponent
 {
 
+    /** The parent filter. */
     protected final LdapFilter parent;
 
+    /** The start token. */
     protected LdapFilterToken startToken;
 
-    protected List filterList;
+    /** The filter list. */
+    protected List<LdapFilter> filterList;
 
 
     /**
+     * The Constructor.
      * 
-     * 
-     * @param parent
-     *                the parent filter of this filter component, not null.
+     * @param parent the parent filter, not null
      */
-    public LdapFilterComponent( LdapFilter parent )
+    protected LdapFilterComponent( LdapFilter parent )
     {
         if ( parent == null )
+        {
             throw new IllegalArgumentException( "parent is null" );
+        }
 
         this.parent = parent;
         this.startToken = null;
-        this.filterList = new ArrayList( 2 );
+        this.filterList = new ArrayList<LdapFilter>( 2 );
     }
 
 
@@ -63,7 +73,7 @@
      */
     public final LdapFilter getParent()
     {
-        return this.parent;
+        return parent;
     }
 
 
@@ -72,6 +82,7 @@
      * isn't set yet and if the given start token isn't null.
      * 
      * @param startToken
+     * 
      * @return true if setting the start token was successful, false
      *         otherwise.
      */
@@ -96,7 +107,7 @@
      */
     public final LdapFilterToken getStartToken()
     {
-        return this.startToken;
+        return startToken;
     }
 
 
@@ -105,13 +116,14 @@
      * was set before and if the filter isn't null.
      * 
      * @param filter
+     * 
      * @return true if adding the filter was successful, false otherwise.
      */
     public boolean addFilter( LdapFilter filter )
     {
-        if ( this.startToken != null && filter != null )
+        if ( startToken != null && filter != null )
         {
-            this.filterList.add( filter );
+            filterList.add( filter );
             return true;
         }
         else
@@ -128,8 +140,8 @@
      */
     public LdapFilter[] getFilters()
     {
-        LdapFilter[] filters = new LdapFilter[this.filterList.size()];
-        this.filterList.toArray( filters );
+        LdapFilter[] filters = new LdapFilter[filterList.size()];
+        filterList.toArray( filters );
         return filters;
     }
 
@@ -141,19 +153,19 @@
      */
     public boolean isValid()
     {
-        if ( this.startToken == null )
+        if ( startToken == null )
         {
             return false;
         }
 
-        if ( this.filterList.isEmpty() )
+        if ( filterList.isEmpty() )
         {
             return false;
         }
 
-        for ( Iterator it = filterList.iterator(); it.hasNext(); )
+        for ( Iterator<LdapFilter> it = filterList.iterator(); it.hasNext(); )
         {
-            LdapFilter filter = ( LdapFilter ) it.next();
+            LdapFilter filter = it.next();
             if ( filter == null || !filter.isValid() )
             {
                 return false;
@@ -167,7 +179,7 @@
     /**
      * Returns the invalid cause.
      * 
-     * @return the invalid cause.
+     * @return the invalid cause, or null if this filter is valid.
      */
     public abstract String getInvalidCause();
 
@@ -181,23 +193,23 @@
      */
     public LdapFilter[] getInvalidFilters()
     {
-        if ( this.startToken == null || this.filterList.isEmpty() )
+        if ( startToken == null || filterList.isEmpty() )
         {
             return new LdapFilter[]
-                { this.parent };
+                { parent };
         }
         else
         {
-            List invalidFilterList = new ArrayList();
-            for ( Iterator it = this.filterList.iterator(); it.hasNext(); )
+            List<LdapFilter> invalidFilterList = new ArrayList<LdapFilter>();
+            for ( Iterator<LdapFilter> it = filterList.iterator(); it.hasNext(); )
             {
-                LdapFilter filter = ( LdapFilter ) it.next();
+                LdapFilter filter = it.next();
                 if ( filter != null )
                 {
                     invalidFilterList.addAll( Arrays.asList( filter.getInvalidFilters() )
);
                 }
             }
-            return ( LdapFilter[] ) invalidFilterList.toArray( new LdapFilter[invalidFilterList.size()]
);
+            return invalidFilterList.toArray( new LdapFilter[invalidFilterList.size()] );
         }
     }
 
@@ -210,14 +222,14 @@
     public LdapFilterToken[] getTokens()
     {
         // collect tokens
-        List tokenList = new ArrayList();
-        if ( this.startToken != null )
+        List<LdapFilterToken> tokenList = new ArrayList<LdapFilterToken>();
+        if ( startToken != null )
         {
-            tokenList.add( this.startToken );
+            tokenList.add( startToken );
         }
-        for ( Iterator it = this.filterList.iterator(); it.hasNext(); )
+        for ( Iterator<LdapFilter> it = filterList.iterator(); it.hasNext(); )
         {
-            LdapFilter filter = ( LdapFilter ) it.next();
+            LdapFilter filter = it.next();
             if ( filter != null )
             {
                 tokenList.addAll( Arrays.asList( filter.getTokens() ) );
@@ -225,7 +237,7 @@
         }
 
         // sort tokens
-        LdapFilterToken[] tokens = ( LdapFilterToken[] ) tokenList.toArray( new LdapFilterToken[tokenList.size()]
);
+        LdapFilterToken[] tokens = tokenList.toArray( new LdapFilterToken[tokenList.size()]
);
         Arrays.sort( tokens );
 
         // return
@@ -237,21 +249,22 @@
      * Returns the filter at the given offset. This may be the whole parent
      * filter or one of the subfilters.
      * 
-     * @param offset
+     * @param offset the offset
+     * 
      * @return the filter at the given offset or null is offset is out of
      *         range.
      */
     public LdapFilter getFilter( int offset )
     {
-        if ( this.startToken != null && this.startToken.getOffset() == offset )
+        if ( startToken != null && startToken.getOffset() == offset )
         {
-            return this.parent;
+            return parent;
         }
-        else if ( this.filterList != null || !this.filterList.isEmpty() )
+        else if ( filterList != null || !filterList.isEmpty() )
         {
-            for ( Iterator it = this.filterList.iterator(); it.hasNext(); )
+            for ( Iterator<LdapFilter> it = filterList.iterator(); it.hasNext(); )
             {
-                LdapFilter filter = ( LdapFilter ) it.next();
+                LdapFilter filter = it.next();
                 if ( filter != null && filter.getFilter( offset ) != null )
                 {
                     return filter.getFilter( offset );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterExtensibleComponent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterExtensibleComponent.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterExtensibleComponent.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterExtensibleComponent.java
Sun Jul 15 08:30:57 2007
@@ -29,7 +29,7 @@
 
 
 /**
- * The LdapFilterExtensibleComponent represents a extensible filter.
+ * The LdapFilterExtensibleComponent represents an extensible filter.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -66,7 +66,7 @@
      * 
      * @param attributeToken the attribute token
      * 
-     * @return true, if set attribute token
+     * @return true, if setting the attribute token was successful,false otherwise.
      */
     public boolean setAttributeToken( LdapFilterToken attributeToken )
     {
@@ -90,7 +90,7 @@
     /**
      * Gets the attribute token.
      * 
-     * @return the attribute token
+     * @return the attribute token, or null if not set
      */
     public LdapFilterToken getAttributeToken()
     {
@@ -103,7 +103,7 @@
      * 
      * @param dnAttrColonToken the dn attr colon token
      * 
-     * @return true, if set dn attr colon token
+     * @return true, if setting the dn attr colon token was sucessful, false otherwise
      */
     public boolean setDnAttrColonToken( LdapFilterToken dnAttrColonToken )
     {
@@ -127,7 +127,7 @@
     /**
      * Gets the dn attr colon token.
      * 
-     * @return the dn attr colon token
+     * @return the dn attr colon token, or null if not set
      */
     public LdapFilterToken getDnAttrColonToken()
     {
@@ -140,7 +140,7 @@
      * 
      * @param dnAttrToken the dn attr token
      * 
-     * @return true, if set dn attr token
+     * @return true, if setting the dn attr token was successful, false otherwise
      */
     public boolean setDnAttrToken( LdapFilterToken dnAttrToken )
     {
@@ -160,7 +160,7 @@
     /**
      * Gets the dn attr token.
      * 
-     * @return the dn attr token
+     * @return the dn attr token, or null if not set
      */
     public LdapFilterToken getDnAttrToken()
     {
@@ -173,7 +173,7 @@
      * 
      * @param matchingRuleColonToken the matching rule colon token
      * 
-     * @return true, if set matching rule colon token
+     * @return true, if setting the matching rule colon token was successful, false otherwise
      */
     public boolean setMatchingRuleColonToken( LdapFilterToken matchingRuleColonToken )
     {
@@ -197,7 +197,7 @@
     /**
      * Gets the matching rule colon token.
      * 
-     * @return the matching rule colon token
+     * @return the matching rule colon token, or null if not set
      */
     public LdapFilterToken getMatchingRuleColonToken()
     {
@@ -210,7 +210,7 @@
      * 
      * @param matchingRuleToken the matching rule token
      * 
-     * @return true, if set matching rule token
+     * @return true, if setting the matching rule token was successful, false otherwise
      */
     public boolean setMatchingRuleToken( LdapFilterToken matchingRuleToken )
     {
@@ -230,7 +230,7 @@
     /**
      * Gets the matching rule token.
      * 
-     * @return the matching rule token
+     * @return the matching rule token, or null if not set
      */
     public LdapFilterToken getMatchingRuleToken()
     {
@@ -243,7 +243,7 @@
      * 
      * @param equalsColonToken the equals colon token
      * 
-     * @return true, if set equals colon token
+     * @return true, if setting the equals colon token was sucessful, false otherwise
      */
     public boolean setEqualsColonToken( LdapFilterToken equalsColonToken )
     {
@@ -263,7 +263,7 @@
     /**
      * Gets the equals colon token.
      * 
-     * @return the equals colon token
+     * @return the equals colon token, or null if not set
      */
     public LdapFilterToken getEqualsColonToken()
     {
@@ -276,7 +276,7 @@
      * 
      * @param equalsToken the equals token
      * 
-     * @return true, if set equals token
+     * @return true, if setting the equals token was successful, false otherwise
      */
     public boolean setEqualsToken( LdapFilterToken equalsToken )
     {
@@ -295,7 +295,7 @@
     /**
      * Gets the equals token.
      * 
-     * @return the equals token
+     * @return the equals token, or null if not set
      */
     public LdapFilterToken getEqualsToken()
     {
@@ -308,7 +308,7 @@
      * 
      * @param valueToken the value token
      * 
-     * @return true, if set value token
+     * @return true, if setting the value token was successful, false otherwise
      */
     public boolean setValueToken( LdapFilterToken valueToken )
     {
@@ -327,7 +327,7 @@
     /**
      * Gets the value token.
      * 
-     * @return the value token
+     * @return the value token, or null if not set
      */
     public LdapFilterToken getValueToken()
     {
@@ -360,37 +360,37 @@
     {
         // collect tokens
         List<LdapFilterToken> tokenList = new ArrayList<LdapFilterToken>();
-        if ( this.attributeToken != null )
+        if ( attributeToken != null )
         {
-            tokenList.add( this.attributeToken );
+            tokenList.add( attributeToken );
         }
-        if ( this.dnAttrColonToken != null )
+        if ( dnAttrColonToken != null )
         {
-            tokenList.add( this.dnAttrColonToken );
+            tokenList.add( dnAttrColonToken );
         }
-        if ( this.dnAttrToken != null )
+        if ( dnAttrToken != null )
         {
-            tokenList.add( this.dnAttrToken );
+            tokenList.add( dnAttrToken );
         }
-        if ( this.matchingRuleColonToken != null )
+        if ( matchingRuleColonToken != null )
         {
-            tokenList.add( this.matchingRuleColonToken );
+            tokenList.add( matchingRuleColonToken );
         }
-        if ( this.matchingRuleToken != null )
+        if ( matchingRuleToken != null )
         {
-            tokenList.add( this.matchingRuleToken );
+            tokenList.add( matchingRuleToken );
         }
-        if ( this.equalsColonToken != null )
+        if ( equalsColonToken != null )
         {
-            tokenList.add( this.equalsColonToken );
+            tokenList.add( equalsColonToken );
         }
-        if ( this.equalsToken != null )
+        if ( equalsToken != null )
         {
-            tokenList.add( this.equalsToken );
+            tokenList.add( equalsToken );
         }
-        if ( this.valueToken != null )
+        if ( valueToken != null )
         {
-            tokenList.add( this.valueToken );
+            tokenList.add( valueToken );
         }
 
         // sort tokens

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterItemComponent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterItemComponent.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterItemComponent.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapFilterItemComponent.java
Sun Jul 15 08:30:57 2007
@@ -28,14 +28,28 @@
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
+/**
+ * The LdapFilterExtensibleComponent represents an simple filter.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+
 public class LdapFilterItemComponent extends LdapFilterComponent
 {
 
+    /** The filtertype token. */
     private LdapFilterToken filtertypeToken;
 
+    /** The value token. */
     private LdapFilterToken valueToken;
 
 
+    /**
+     * Creates a new instance of LdapFilterItemComponent.
+     * 
+     * @param parent the parent filter
+     */
     public LdapFilterItemComponent( LdapFilter parent )
     {
         super( parent );
@@ -44,6 +58,9 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#setStartToken(org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken)
+     */
     public boolean setStartToken( LdapFilterToken attributeToken )
     {
         if ( attributeToken != null && attributeToken.getType() == LdapFilterToken.ATTRIBUTE
)
@@ -58,18 +75,37 @@
     }
 
 
+    /**
+     * Sets the attribute token.
+     * 
+     * @param attributeToken the attribute token
+     * 
+     * @return true, if setting the attribute token was successful, false otherwise
+     */
     public boolean setAttributeToken( LdapFilterToken attributeToken )
     {
         return this.setStartToken( attributeToken );
     }
 
 
+    /**
+     * Gets the attribute token.
+     * 
+     * @return the attribute token, null if not set
+     */
     public LdapFilterToken getAttributeToken()
     {
-        return this.getStartToken();
+        return getStartToken();
     }
 
 
+    /**
+     * Sets the filtertype token.
+     * 
+     * @param filtertypeToken the filtertype token
+     * 
+     * @return true, if setting the filtertype token was successful, false otherwise
+     */
     public boolean setFiltertypeToken( LdapFilterToken filtertypeToken )
     {
         if ( this.filtertypeToken == null
@@ -89,12 +125,24 @@
     }
 
 
+    /**
+     * Gets the filter token.
+     * 
+     * @return the filter token, null if not set
+     */
     public LdapFilterToken getFilterToken()
     {
-        return this.filtertypeToken;
+        return filtertypeToken;
     }
 
 
+    /**
+     * Sets the value token.
+     * 
+     * @param valueToken the value token
+     * 
+     * @return true, if setting the value token was successful, false otherwise
+     */
     public boolean setValueToken( LdapFilterToken valueToken )
     {
         if ( this.valueToken == null && valueToken != null && valueToken.getType()
== LdapFilterToken.VALUE )
@@ -109,12 +157,20 @@
     }
 
 
+    /**
+     * Gets the value token.
+     * 
+     * @return the value token, null if not set
+     */
     public LdapFilterToken getValueToken()
     {
-        return this.valueToken;
+        return valueToken;
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#isValid()
+     */
     public boolean isValid()
     {
         return startToken != null && filtertypeToken != null
@@ -122,25 +178,28 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getTokens()
+     */
     public LdapFilterToken[] getTokens()
     {
         // collect tokens
-        List tokenList = new ArrayList();
-        if ( this.startToken != null )
+        List<LdapFilterToken> tokenList = new ArrayList<LdapFilterToken>();
+        if ( startToken != null )
         {
-            tokenList.add( this.startToken );
+            tokenList.add( startToken );
         }
-        if ( this.filtertypeToken != null )
+        if ( filtertypeToken != null )
         {
-            tokenList.add( this.filtertypeToken );
+            tokenList.add( filtertypeToken );
         }
-        if ( this.valueToken != null )
+        if ( valueToken != null )
         {
-            tokenList.add( this.valueToken );
+            tokenList.add( valueToken );
         }
 
         // sort tokens
-        LdapFilterToken[] tokens = ( LdapFilterToken[] ) tokenList.toArray( new LdapFilterToken[tokenList.size()]
);
+        LdapFilterToken[] tokens = tokenList.toArray( new LdapFilterToken[tokenList.size()]
);
         Arrays.sort( tokens );
 
         // return
@@ -148,6 +207,9 @@
     }
 
 
+    /**
+     * @see java.lang.Object#toString()
+     */
     public String toString()
     {
         return ( startToken != null ? startToken.getValue() : "" )
@@ -156,15 +218,23 @@
     }
 
 
+    /**
+     * This implementation does nothing and returns always false.
+     * 
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#addFilter(org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilter)
+     */
     public boolean addFilter( LdapFilter filter )
     {
         return false;
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getInvalidFilters()
+     */
     public LdapFilter[] getInvalidFilters()
     {
-        if ( this.isValid() )
+        if ( isValid() )
         {
             return new LdapFilter[0];
         }
@@ -176,22 +246,25 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getFilter(int)
+     */
     public LdapFilter getFilter( int offset )
     {
-        if ( this.startToken != null && this.startToken.getOffset() <= offset
-            && offset < this.startToken.getOffset() + this.startToken.getLength()
)
+        if ( startToken != null && startToken.getOffset() <= offset
+            && offset < startToken.getOffset() + startToken.getLength() )
         {
-            return this.parent;
+            return parent;
         }
-        else if ( this.filtertypeToken != null && this.filtertypeToken.getOffset()
<= offset
-            && offset < this.filtertypeToken.getOffset() + this.filtertypeToken.getLength()
)
+        else if ( filtertypeToken != null && filtertypeToken.getOffset() <= offset
+            && offset < filtertypeToken.getOffset() + filtertypeToken.getLength()
)
         {
-            return this.parent;
+            return parent;
         }
-        else if ( this.valueToken != null && this.valueToken.getOffset() <= offset
-            && offset < this.valueToken.getOffset() + this.valueToken.getLength()
)
+        else if ( valueToken != null && valueToken.getOffset() <= offset
+            && offset < valueToken.getOffset() + valueToken.getLength() )
         {
-            return this.parent;
+            return parent;
         }
         else
         {
@@ -200,17 +273,20 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getInvalidCause()
+     */
     public String getInvalidCause()
     {
-        if ( this.startToken == null )
+        if ( startToken == null )
         {
             return "Missing attribute name";
         }
-        else if ( this.filtertypeToken == null )
+        else if ( filtertypeToken == null )
         {
             return "Missing filter type, select one of '=', '>=', '<=','~='";
         }
-        else if ( this.valueToken == null )
+        else if ( valueToken == null )
         {
             return "Missing value";
         }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapNotFilterComponent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapNotFilterComponent.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapNotFilterComponent.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapNotFilterComponent.java
Sun Jul 15 08:30:57 2007
@@ -24,15 +24,29 @@
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
+/**
+ * The LdapNotFilterComponent represents an NOT filter branch.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class LdapNotFilterComponent extends LdapFilterComponent
 {
 
+    /**
+     * Creates a new instance of LdapNotFilterComponent.
+     * 
+     * @param parent the parent filter
+     */
     public LdapNotFilterComponent( LdapFilter parent )
     {
         super( parent );
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#setStartToken(org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken)
+     */
     public boolean setStartToken( LdapFilterToken notToken )
     {
         if ( notToken != null && notToken.getType() == LdapFilterToken.NOT )
@@ -47,13 +61,11 @@
 
 
     /**
-     * Checks additionally if the the filter wasn't set before.
-     * 
-     * @see LdapFilterComponent#addFilter(LdapFilter)
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#addFilter(org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilter)
      */
     public boolean addFilter( LdapFilter filter )
     {
-        if ( this.filterList.isEmpty() )
+        if ( filterList.isEmpty() )
         {
             return super.addFilter( filter );
         }
@@ -66,13 +78,16 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getInvalidCause()
+     */
     public String getInvalidCause()
     {
-        if ( this.startToken == null )
+        if ( startToken == null )
         {
             return "Missing NOT character '!'";
         }
-        else if ( this.filterList == null || this.filterList.isEmpty() )
+        else if ( filterList == null || filterList.isEmpty() )
         {
             return "Missing filter expression";
         }
@@ -83,10 +98,12 @@
     }
 
 
+    /**
+     * @see java.lang.Object#toString()
+     */
     public String toString()
     {
-        return ( this.startToken != null ? "!" : "" )
-            + ( !this.filterList.isEmpty() ? this.filterList.get( 0 ).toString() : "" );
+        return ( startToken != null ? "!" : "" ) + ( !filterList.isEmpty() ? filterList.get(
0 ).toString() : "" );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java?view=diff&rev=556416&r1=556415&r2=556416
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java
Sun Jul 15 08:30:57 2007
@@ -26,15 +26,29 @@
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
+/**
+ * The LdapOrFilterComponent represents an OR filter branch.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class LdapOrFilterComponent extends LdapFilterComponent
 {
 
+    /**
+     * Creates a new instance of LdapOrFilterComponent.
+     * 
+     * @param parent the parent filter
+     */
     public LdapOrFilterComponent( LdapFilter parent )
     {
         super( parent );
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#setStartToken(org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken)
+     */
     public boolean setStartToken( LdapFilterToken orToken )
     {
         if ( orToken != null && orToken.getType() == LdapFilterToken.OR )
@@ -48,13 +62,16 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.filter.LdapFilterComponent#getInvalidCause()
+     */
     public String getInvalidCause()
     {
-        if ( this.startToken == null )
+        if ( startToken == null )
         {
             return "Missing OR character '|'";
         }
-        else if ( this.filterList == null || this.filterList.isEmpty() )
+        else if ( filterList == null || filterList.isEmpty() )
         {
             return "Missing filters";
         }
@@ -65,9 +82,12 @@
     }
 
 
+    /**
+     * @see java.lang.Object#toString()
+     */
     public String toString()
     {
-        String s = this.startToken != null ? "|" : "";
+        String s = startToken != null ? "|" : "";
         for ( Iterator it = filterList.iterator(); it.hasNext(); )
         {
             LdapFilter filter = ( LdapFilter ) it.next();



Mime
View raw message