directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1003801 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/
Date Sat, 02 Oct 2010 14:20:36 GMT
Author: seelmann
Date: Sat Oct  2 14:20:35 2010
New Revision: 1003801

URL: http://svn.apache.org/viewvc?rev=1003801&view=rev
Log:
Added Javadoc

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ComponentsMonitor.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryComponentsMonitor.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/OptionalComponentsMonitor.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java?rev=1003801&r1=1003800&r2=1003801&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java
Sat Oct  2 14:20:35 2010
@@ -29,18 +29,33 @@ import java.util.List;
 import org.apache.directory.shared.i18n.I18n;
 
 
+/**
+ * Abstract implementation of a components monitor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public abstract class AbstractSimpleComponentsMonitor implements ComponentsMonitor
 {
+
+    /** The components. */
     private List<String> components;
 
 
-    public AbstractSimpleComponentsMonitor(String[] components)
+    /**
+     * Instantiates a new abstract simple components monitor.
+     *
+     * @param components the components
+     */
+    public AbstractSimpleComponentsMonitor( String[] components )
     {
         // register components
         this.components = new LinkedList<String>( Arrays.asList( components ) );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ComponentsMonitor useComponent( String component ) throws IllegalArgumentException
     {
         if ( !components.remove( component ) )
@@ -52,17 +67,21 @@ public abstract class AbstractSimpleComp
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean allComponentsUsed()
     {
         return components.isEmpty();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public List<String> getRemainingComponents()
     {
         return Collections.unmodifiableList( components );
     }
 
-
-    public abstract boolean finalStateValid();
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ComponentsMonitor.java?rev=1003801&r1=1003800&r2=1003801&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ComponentsMonitor.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ComponentsMonitor.java
Sat Oct  2 14:20:35 2010
@@ -23,17 +23,46 @@ package org.apache.directory.shared.ldap
 import java.util.List;
 
 
+/**
+ * Monitor used to track existence or duplication of components.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface ComponentsMonitor
 {
-    public ComponentsMonitor useComponent( String component ) throws IllegalArgumentException;
 
-
-    public boolean allComponentsUsed();
-
-
-    public boolean finalStateValid();
-
-
-    public List getRemainingComponents();
+    /**
+     * Use a component.
+     *
+     * @param component the component
+     * @return this components monitor
+     * @throws IllegalArgumentException if the component is already used
+     */
+    ComponentsMonitor useComponent( String component ) throws IllegalArgumentException;
+
+
+    /**
+     * Check if all components are used.
+     *
+     * @return true if all components are used
+     */
+    boolean allComponentsUsed();
+
+
+    /**
+     * Checks if the final state is valid. That depends whether the components are mandatory
+     * or optional.
+     *
+     * @return true if the final state is valid
+     */
+    boolean finalStateValid();
+
+
+    /**
+     * Gets the remaining components.
+     *
+     * @return the remaining components
+     */
+    List<String> getRemainingComponents();
 
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java?rev=1003801&r1=1003800&r2=1003801&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java
Sat Oct  2 14:20:35 2010
@@ -28,14 +28,30 @@ import java.util.List;
 import org.apache.directory.shared.i18n.I18n;
 
 
+/**
+ * A monitor that tracks both, mandatory and optional components.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class MandatoryAndOptionalComponentsMonitor implements ComponentsMonitor
 {
+
+    /** The mandatory components monitor. */
     private ComponentsMonitor mandatoryComponentsMonitor;
 
+    /** The optional components monitor. */
     private ComponentsMonitor optionalComponentsMonitor;
 
 
-    public MandatoryAndOptionalComponentsMonitor(String[] mandatoryComponents, String[] optionalComponents)
+    /**
+     * Instantiates a new mandatory and optional components monitor. The mandatory and optional
+     * components must be disjunct.
+     *
+     * @param mandatoryComponents the mandatory components
+     * @param optionalComponents the optional components
+     * @throws IllegalArgumentException if the same component is defined as mandatory and
optional
+     */
+    public MandatoryAndOptionalComponentsMonitor( String[] mandatoryComponents, String[]
optionalComponents )
         throws IllegalArgumentException
     {
         // check for common elements
@@ -55,6 +71,9 @@ public class MandatoryAndOptionalCompone
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ComponentsMonitor useComponent( String component )
     {
         try
@@ -77,21 +96,30 @@ public class MandatoryAndOptionalCompone
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean allComponentsUsed()
     {
         return ( mandatoryComponentsMonitor.allComponentsUsed() && optionalComponentsMonitor.allComponentsUsed()
);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean finalStateValid()
     {
         return ( mandatoryComponentsMonitor.finalStateValid() && optionalComponentsMonitor.finalStateValid()
);
     }
 
 
-    public List getRemainingComponents()
+    /**
+     * {@inheritDoc}
+     */
+    public List<String> getRemainingComponents()
     {
-        List remainingComponents = new LinkedList();
+        List<String> remainingComponents = new LinkedList<String>();
 
         remainingComponents.addAll( mandatoryComponentsMonitor.getRemainingComponents() );
         remainingComponents.addAll( optionalComponentsMonitor.getRemainingComponents() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryComponentsMonitor.java?rev=1003801&r1=1003800&r2=1003801&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryComponentsMonitor.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryComponentsMonitor.java
Sat Oct  2 14:20:35 2010
@@ -21,14 +21,31 @@
 package org.apache.directory.shared.ldap.util;
 
 
+/**
+ * A components monitor for manadatory components.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class MandatoryComponentsMonitor extends AbstractSimpleComponentsMonitor
 {
-    public MandatoryComponentsMonitor(String[] components)
+
+    /**
+     * Instantiates a new mandatory components monitor.
+     *
+     * @param components the components
+     */
+    public MandatoryComponentsMonitor( String[] components )
     {
         super( components );
     }
 
 
+    /**
+     * Checks if the final state is valid. As all components are mandatory it checks 
+     * whether all components are used.
+     * 
+     * @return true if all components are used
+     */
     public boolean finalStateValid()
     {
         return allComponentsUsed();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/OptionalComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/OptionalComponentsMonitor.java?rev=1003801&r1=1003800&r2=1003801&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/OptionalComponentsMonitor.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/OptionalComponentsMonitor.java
Sat Oct  2 14:20:35 2010
@@ -21,14 +21,31 @@
 package org.apache.directory.shared.ldap.util;
 
 
+/**
+ * A components monitor for optional components.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class OptionalComponentsMonitor extends AbstractSimpleComponentsMonitor
 {
-    public OptionalComponentsMonitor(String[] components)
+
+    /**
+     * Instantiates a new optional components monitor.
+     *
+     * @param components the components
+     */
+    public OptionalComponentsMonitor( String[] components )
     {
         super( components );
     }
 
 
+    /**
+     * Checks if the final state is valid. As all components are optional this
+     * implementation always returns true.
+     * 
+     * @return always true
+     */
     public boolean finalStateValid()
     {
         return true;



Mime
View raw message