directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r944902 - in /directory/shared/trunk: cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ i18n/src/main/java/org/apache/directory/shared/i18n/ i18n/src/main/resources/org/apache/directory/shared/i18n/
Date Sun, 16 May 2010 20:06:42 GMT
Author: felixk
Date: Sun May 16 20:06:42 2010
New Revision: 944902

URL: http://svn.apache.org/viewvc?rev=944902&view=rev
Log:
Resolve DIRSHARED-58, add missing methods to interface and implement missing methods in EmptyCursor

Modified:
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/Cursor.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java
    directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/Cursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/Cursor.java?rev=944902&r1=944901&r2=944902&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/Cursor.java
(original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/Cursor.java
Sun May 16 20:06:42 2010
@@ -118,6 +118,30 @@ public interface Cursor<E> extends Itera
 
 
     /**
+     * Is this Cursor positioned at the first element.
+     *
+     * @return true if this cursor is positioned at the first element, 
+     * false otherwise
+     * @throws Exception if there are problems querying the position of this Cursor
+     * or if this Cursor is closed
+     * @throws UnsupportedOperationException if this method is not supported
+     */
+    boolean isFirst() throws Exception;
+
+    
+    /**
+     * Is this Cursor positioned before the first element.
+     *
+     * @return true if this cursor is positioned before the first element, 
+     * false otherwise
+     * @throws Exception if there are problems querying the position of this Cursor
+     * or if this Cursor is closed
+     * @throws UnsupportedOperationException if this method is not supported
+     */
+    boolean isBeforeFirst() throws Exception;
+
+    
+    /**
      * Positions this Cursor at the last element.
      *
      * @return true if the position has been successfully changed to the last
@@ -130,6 +154,30 @@ public interface Cursor<E> extends Itera
 
 
     /**
+     * Is this Cursor positioned at the last element.
+     *
+     * @return true if this cursor is positioned at the last element, 
+     * false otherwise
+     * @throws Exception if there are problems querying the position of this Cursor
+     * or if this Cursor is closed
+     * @throws UnsupportedOperationException if this method is not supported
+     */
+    boolean isLast() throws Exception;
+
+    
+    /**
+     * Is this Cursor positioned after the last element.
+     *
+     * @return true if this cursor is positioned after the last element, 
+     * false otherwise
+     * @throws Exception if there are problems querying the position of this Cursor
+     * or if this Cursor is closed
+     * @throws UnsupportedOperationException if this method is not supported
+     */
+    boolean isAfterLast() throws Exception;
+
+    
+    /**
      * Checks if this Cursor is closed.  Calls to this operation should not
      * fail with exceptions if and only if the cursor is in the closed state.
      *

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java?rev=944902&r1=944901&r2=944902&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java
(original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java
Sun May 16 20:06:42 2010
@@ -130,4 +130,40 @@ public class EmptyCursor<E> extends Abst
     {
         return false;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+	public boolean isAfterLast() throws Exception {
+		throw new UnsupportedOperationException( I18n.err(I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
+				.concat( "." ).concat( "isAfterLast()" )));
+	}
+
+
+    /**
+     * {@inheritDoc}
+     */
+	public boolean isBeforeFirst() throws Exception {
+		throw new UnsupportedOperationException( I18n.err(I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
+				.concat( "." ).concat( "isBeforeFirst()" )));
+	}
+
+
+    /**
+     * {@inheritDoc}
+     */
+	public boolean isFirst() throws Exception {
+		throw new UnsupportedOperationException( I18n.err(I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
+				.concat( "." ).concat( "isFirst()" )));
+	}
+
+
+    /**
+     * {@inheritDoc}
+     */
+	public boolean isLast() throws Exception {
+		throw new UnsupportedOperationException( I18n.err(I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
+				.concat( "." ).concat( "isLast()" )));
+	}
 }

Modified: directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java?rev=944902&r1=944901&r2=944902&view=diff
==============================================================================
--- directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java (original)
+++ directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java Sun
May 16 20:06:42 2010
@@ -99,6 +99,7 @@ public class I18n
 	public static final String ERR_02011 = "ERR_02011";
 	public static final String ERR_02012 = "ERR_02012";
 	public static final String ERR_02013 = "ERR_02013";
+	public static final String ERR_02014_UNSUPPORTED_OPERATION = "ERR_02014_UNSUPPORTED_OPERATION";
 
 	// dsml-parser
 	public static final String ERR_03001 = "ERR_03001";
@@ -788,7 +789,7 @@ public class I18n
      *
      * @param err The error code
      * @param args The argument(s)
-     * @return
+     * @return The translated error
      */
     public static String err( String err, Object... args )
     {
@@ -823,7 +824,7 @@ public class I18n
      *
      * @param msg The message
      * @param args The argument(s)
-     * @return
+     * @return The translated error
      */
     public static String msg( String msg, Object... args )
     {

Modified: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties?rev=944902&r1=944901&r2=944902&view=diff
==============================================================================
--- directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
(original)
+++ directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
Sun May 16 20:06:42 2010
@@ -58,6 +58,7 @@ ERR_02010=Without a comparator I cannot 
 ERR_02011=Without a comparator I cannot advance to just after the specified element.
 ERR_02012=Cannot access element if positioned before first.
 ERR_02013=Cannot access element if positioned after last.
+ERR_02014_UNSUPPORTED_OPERATION=The method method {0} is not supported
 
 # dsml-parser
 ERR_03001={0} - Line {1} - Column {2}



Mime
View raw message