jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770212 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventIteratorAdapter.java
Date Thu, 30 Apr 2009 12:56:26 GMT
Author: jukka
Date: Thu Apr 30 12:56:26 2009
New Revision: 770212

URL: http://svn.apache.org/viewvc?rev=770212&view=rev
Log:
JCR-2086: JSR 283: Implementation of EventIterator.getDate

Added EventIteratorAdapter.getDate()

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventIteratorAdapter.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventIteratorAdapter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventIteratorAdapter.java?rev=770212&r1=770211&r2=770212&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventIteratorAdapter.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/EventIteratorAdapter.java
Thu Apr 30 12:56:26 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.commons.iterator;
 
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
@@ -38,12 +39,28 @@
         new EventIteratorAdapter(RangeIteratorAdapter.EMPTY);
 
     /**
+     * Date associated with this iterator.
+     */
+    private final Calendar date;
+
+    /**
+     * Creates an adapter for the given {@link RangeIterator}.
+     *
+     * @param iterator iterator of {@link Event}s
+     */
+    public EventIteratorAdapter(EventIterator iterator) {
+        super(iterator);
+        this.date = iterator.getDate();
+    }
+
+    /**
      * Creates an adapter for the given {@link RangeIterator}.
      *
      * @param iterator iterator of {@link Event}s
      */
     public EventIteratorAdapter(RangeIterator iterator) {
         super(iterator);
+        this.date = null;
     }
 
     /**
@@ -53,6 +70,7 @@
      */
     public EventIteratorAdapter(Iterator iterator) {
         super(new RangeIteratorAdapter(iterator));
+        this.date = null;
     }
 
     /**
@@ -62,6 +80,7 @@
      */
     public EventIteratorAdapter(Collection collection) {
         super(new RangeIteratorAdapter(collection));
+        this.date = null;
     }
 
     //-------------------------------------------------------< EventIterator >
@@ -76,4 +95,13 @@
         return (Event) next();
     }
 
+    /**
+     * Returns the date associated with this iterator.
+     *
+     * @return date associated with this iterator, or <code>null</code> 
+     */
+    public Calendar getDate() {
+        return date;
+    }
+
 }



Mime
View raw message