lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1363203 [2/3] - in /lucene/dev/branches/LUCENE-2878: lucene/core/src/java/org/apache/lucene/search/ lucene/core/src/java/org/apache/lucene/search/positions/ lucene/core/src/java/org/apache/lucene/search/spans/ lucene/core/src/test/org/apac...
Date Thu, 19 Jul 2012 02:01:50 GMT
Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueAnd.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueAnd.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueAnd.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueAnd.java Thu Jul 19 02:01:47 2012
@@ -16,7 +16,6 @@ package org.apache.lucene.search.positio
  * limitations under the License.
  */
 
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
 /**
  * 
  * @lucene.experimental
@@ -40,7 +39,7 @@ final class IntervalQueueAnd extends Int
   }
 
   public void updateRightExtreme(IntervalRef intervalRef) {
-    final PositionInterval interval = intervalRef.interval;
+    final Interval interval = intervalRef.interval;
     if (rightExtreme <= interval.end) {
       rightExtreme = interval.end;
       rightExtremeOffset = interval.offsetEnd;
@@ -49,14 +48,14 @@ final class IntervalQueueAnd extends Int
   }
   
   public boolean topContainsQueueInterval() {
-    PositionInterval interval = top().interval;
+    Interval interval = top().interval;
     return interval.begin < currentCandidate.begin
         && currentCandidate.end < rightExtreme;
   }
  
   public void updateCurrentCandidate() {
     final IntervalRef top = top();
-    PositionInterval interval = top.interval;
+    Interval interval = top.interval;
     currentCandidate.begin = interval.begin;
     currentCandidate.offsetBegin = interval.offsetBegin;
     currentCandidate.end = rightExtreme;
@@ -67,8 +66,8 @@ final class IntervalQueueAnd extends Int
   
   @Override
   protected boolean lessThan(IntervalRef left, IntervalRef right) {
-    final PositionInterval a = left.interval;
-    final PositionInterval b = right.interval;
+    final Interval a = left.interval;
+    final Interval b = right.interval;
     return a.begin < b.begin || (a.begin == b.begin && a.end > b.end) || a.offsetBegin < b.offsetBegin;
   }
   

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueOr.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueOr.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueOr.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/IntervalQueueOr.java Thu Jul 19 02:01:47 2012
@@ -15,7 +15,6 @@ package org.apache.lucene.search.positio
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
 /**
  * 
  * @lucene.experimental
@@ -27,7 +26,7 @@ final class IntervalQueueOr extends Inte
   }
   
   public boolean topContainsQueueInterval() {
-    PositionInterval interval = top().interval;
+    Interval interval = top().interval;
     return interval.begin <= currentCandidate.begin
         && currentCandidate.end <= interval.end;
   }
@@ -38,8 +37,8 @@ final class IntervalQueueOr extends Inte
   
   @Override
   protected boolean lessThan(IntervalRef left, IntervalRef right) {
-    final PositionInterval a = left.interval;
-    final PositionInterval b = right.interval;
+    final Interval a = left.interval;
+    final Interval b = right.interval;
     return a.end < b.end || (a.end == b.end && a.begin >= b.begin);
   }
 

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionIntervalIterator.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionPositionIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionPositionIterator.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionPositionIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -23,40 +23,40 @@ import org.apache.lucene.search.Scorer;
 /**
  * @lucene.experimental
  */ // nocommit - javadoc
-public final class OrderedConjunctionPositionIterator extends
-    PositionIntervalIterator {
+public final class OrderedConjunctionIntervalIterator extends
+    IntervalIterator {
 
-  private final PositionIntervalIterator[] iterators;
-  private static final PositionInterval INFINITE_INTERVAL = new PositionInterval(
+  private final IntervalIterator[] iterators;
+  private static final Interval INFINITE_INTERVAL = new Interval(
       Integer.MIN_VALUE, Integer.MIN_VALUE, -1, -1);
-  private final PositionInterval[] intervals;
+  private final Interval[] intervals;
   private final int lastIter;
-  private final PositionInterval interval = new PositionInterval(
+  private final Interval interval = new Interval(
       Integer.MAX_VALUE, Integer.MAX_VALUE, -1, -1);
   private int index = 1;
   private int lastTopEnd;
   private int lastEndBegin;
   
   
-  public OrderedConjunctionPositionIterator(boolean collectPositions, PositionIntervalIterator other) {
+  public OrderedConjunctionIntervalIterator(boolean collectPositions, IntervalIterator other) {
     super(other.scorer, collectPositions);
     assert other.subs(true) != null;
     iterators = other.subs(true);
     assert iterators.length > 1;
-    intervals = new PositionInterval[iterators.length];
+    intervals = new Interval[iterators.length];
     lastIter = iterators.length - 1;
   }
   
-  public OrderedConjunctionPositionIterator(Scorer scorer, boolean collectPositions, PositionIntervalIterator... iterators) throws IOException {
+  public OrderedConjunctionIntervalIterator(Scorer scorer, boolean collectPositions, IntervalIterator... iterators) throws IOException {
     super(scorer, collectPositions);
     this.iterators = iterators;
     assert iterators.length > 1;
-    intervals = new PositionInterval[iterators.length];
+    intervals = new Interval[iterators.length];
     lastIter = iterators.length - 1;
   }
 
   @Override
-  public PositionInterval next() throws IOException {
+  public Interval next() throws IOException {
     if(intervals[0] == null) {
       return null;
     }
@@ -67,16 +67,16 @@ public final class OrderedConjunctionPos
     int b = Integer.MAX_VALUE;
     while (true) {
       while (true) {
-        final PositionInterval previous = intervals[index - 1];
+        final Interval previous = intervals[index - 1];
         if (previous.end >= b) {
           return interval.begin == Integer.MAX_VALUE ? null : interval;
         }
         if (index == intervals.length || intervals[index].begin > previous.end) {
           break;
         }
-        PositionInterval current = intervals[index];
+        Interval current = intervals[index];
         do {
-          final PositionInterval next;
+          final Interval next;
           if (current.end >= b || (next = iterators[index].next()) == null) {
             return interval.begin == Integer.MAX_VALUE ? null : interval;
           }
@@ -101,15 +101,15 @@ public final class OrderedConjunctionPos
   }
 
   @Override
-  public PositionIntervalIterator[] subs(boolean inOrder) {
+  public IntervalIterator[] subs(boolean inOrder) {
     return iterators;
   }
 
   @Override
-  public void collect(PositionCollector collector) {
+  public void collect(IntervalCollector collector) {
     assert collectPositions;
     collector.collectComposite(scorer, interval, currentDoc);
-    for (PositionIntervalIterator iter : iterators) {
+    for (IntervalIterator iter : iterators) {
       iter.collect(collector);
     }
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionQuery.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/OrderedConjunctionQuery.java Thu Jul 19 02:01:47 2012
@@ -21,7 +21,7 @@ import org.apache.lucene.search.BooleanC
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Query;
 
-public class OrderedConjunctionQuery extends PositionFilterQuery {
+public class OrderedConjunctionQuery extends IntervalFilterQuery {
 
   public OrderedConjunctionQuery(int slop, Query... queries) {
     super(buildBooleanQuery(queries), new WithinOrderedFilter(slop + queries.length - 1));

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangeIntervalIterator.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangePositionsIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangeIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangeIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangePositionsIterator.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangePositionsIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/RangeIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -18,24 +18,24 @@ package org.apache.lucene.search.positio
 
 import java.io.IOException;
 
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionIntervalFilter;
+import org.apache.lucene.search.positions.IntervalIterator.IntervalFilter;
 
 /**
  * 
  * @lucene.experimental
  */ // nocommit - javadoc
-public class RangePositionsIterator extends PositionIntervalIterator implements PositionIntervalFilter {
+public class RangeIntervalIterator extends IntervalIterator implements IntervalFilter {
 
-  private final PositionIntervalIterator iterator;
-  private PositionInterval interval;
+  private final IntervalIterator iterator;
+  private Interval interval;
   private int start;
   private int end;
   
-  public RangePositionsIterator(int start, int end) {
+  public RangeIntervalIterator(int start, int end) {
     this(start, end, null);
   }
   
-  public RangePositionsIterator(int start, int end, PositionIntervalIterator iterator) {
+  public RangeIntervalIterator(int start, int end, IntervalIterator iterator) {
     super(iterator != null ? iterator.scorer : null,
         iterator != null ? iterator.collectPositions : false);
     this.iterator = iterator;
@@ -43,12 +43,12 @@ public class RangePositionsIterator exte
     this.end = end;
   }
 
-  public PositionIntervalIterator filter(PositionIntervalIterator iter) {
-    return new RangePositionsIterator(start, end, iter);
+  public IntervalIterator filter(IntervalIterator iter) {
+    return new RangeIntervalIterator(start, end, iter);
   }  
   
   @Override
-  public PositionInterval next() throws IOException {
+  public Interval next() throws IOException {
     while ((interval = iterator.next()) != null) {
       if(interval.end > end) {
         return null;
@@ -60,12 +60,12 @@ public class RangePositionsIterator exte
   }
 
   @Override
-  public PositionIntervalIterator[] subs(boolean inOrder) {
-    return new PositionIntervalIterator[] { iterator };
+  public IntervalIterator[] subs(boolean inOrder) {
+    return new IntervalIterator[] { iterator };
   }
 
   @Override
-  public void collect(PositionCollector collector) {
+  public void collect(IntervalCollector collector) {
     assert collectPositions;
     collector.collectComposite(null, interval, iterator.docID());
     iterator.collect(collector);

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/SloppyIntervalIterator.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/MaxLengthPositionIntervalIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/SloppyIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/SloppyIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/MaxLengthPositionIntervalIterator.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/MaxLengthPositionIntervalIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/SloppyIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -23,23 +23,22 @@ import org.apache.lucene.search.Scorer;
 /**
  * An interval iterator that has the semantics of sloppy phrase query.
  */
-public class MaxLengthPositionIntervalIterator extends PositionIntervalIterator {
-  //TODO rename to sloppy iter?
+public class SloppyIntervalIterator extends IntervalIterator {
   private final int maxLen;
   private int matchDistance;
-  private final PositionIntervalIterator iterator;
+  private final IntervalIterator iterator;
   
-  public MaxLengthPositionIntervalIterator(Scorer scorer, int maxLength,
-      boolean collectPositions, PositionIntervalIterator iterator)
+  public SloppyIntervalIterator(Scorer scorer, int maxLength,
+      boolean collectPositions, IntervalIterator... iterators)
       throws IOException {
     super(scorer, collectPositions);
     this.maxLen = maxLength;
-    this.iterator = iterator;
+    this.iterator = new ConjunctionIntervalIterator(scorer, collectPositions, iterators);
   }
   
   @Override
-  public PositionInterval next() throws IOException {
-    PositionInterval current;
+  public Interval next() throws IOException {
+    Interval current;
     do {
       if ((current = iterator.next()) != null) {
         matchDistance = current.end - current.begin;
@@ -63,8 +62,8 @@ public class MaxLengthPositionIntervalIt
     return matchDistance;
   }
   
-  public static PositionIntervalIterator create(Scorer scorer, boolean collectPositions,
-        PositionIntervalIterator iterator, int... offsets) {
+  public static IntervalIterator create(Scorer scorer, boolean collectPositions,
+        IntervalIterator iterator, int... offsets) {
     if (offsets.length == 1) {
       return new SingleSlopplyIntervalIterator(scorer, collectPositions, iterator, offsets[0]);
     } else {
@@ -74,14 +73,14 @@ public class MaxLengthPositionIntervalIt
   }
   
   private final static class SingleSlopplyIntervalIterator extends
-      PositionIntervalIterator {
-    private PositionInterval realInterval;
-    private final PositionInterval sloppyInterval = new PositionInterval();
-    private final PositionIntervalIterator iterator;
+      IntervalIterator {
+    private Interval realInterval;
+    private final Interval sloppyInterval = new Interval();
+    private final IntervalIterator iterator;
     private int offset;
     
     public SingleSlopplyIntervalIterator(Scorer scorer,
-        boolean collectPositions, PositionIntervalIterator iterator, int offset) {
+        boolean collectPositions, IntervalIterator iterator, int offset) {
       super(scorer, collectPositions);
       this.iterator = iterator;
       this.offset = offset;
@@ -93,7 +92,7 @@ public class MaxLengthPositionIntervalIt
     }
     
     @Override
-    public PositionInterval next() throws IOException {
+    public Interval next() throws IOException {
       if ((realInterval = iterator.next()) != null) {
         sloppyInterval.begin = sloppyInterval.end = realInterval.begin - offset;
         sloppyInterval.offsetBegin = realInterval.offsetBegin;
@@ -104,13 +103,13 @@ public class MaxLengthPositionIntervalIt
     }
     
     @Override
-    public void collect(PositionCollector collector) {
+    public void collect(IntervalCollector collector) {
       collector.collectLeafPosition(scorer, realInterval, currentDoc);
       
     }
     
     @Override
-    public PositionIntervalIterator[] subs(boolean inOrder) {
+    public IntervalIterator[] subs(boolean inOrder) {
       return null;
     }
 
@@ -122,23 +121,23 @@ public class MaxLengthPositionIntervalIt
   }
   
   private final static class SloppyGroupIntervalIterator extends
-      PositionIntervalIterator {
+      IntervalIterator {
     
-    private final PositionInterval sloppyGroupInterval = new PositionInterval();
+    private final Interval sloppyGroupInterval = new Interval();
     private final int[] offsets;
-    private final PositionInterval[] intervalPositions;
-    private final PositionIntervalIterator groupIterator;
+    private final Interval[] intervalPositions;
+    private final IntervalIterator groupIterator;
     private int currentIndex;
     private boolean initialized;
     
     public SloppyGroupIntervalIterator(Scorer scorer, boolean collectPositions,
-        PositionIntervalIterator groupIterator, int... offsets) {
+        IntervalIterator groupIterator, int... offsets) {
       super(scorer, collectPositions);
       this.offsets = offsets;
       this.groupIterator = groupIterator;
-      this.intervalPositions = new PositionInterval[offsets.length];
+      this.intervalPositions = new Interval[offsets.length];
       for (int i = 0; i < intervalPositions.length; i++) {
-        intervalPositions[i] = new PositionInterval();
+        intervalPositions[i] = new Interval();
       }
     }
     
@@ -149,7 +148,7 @@ public class MaxLengthPositionIntervalIt
     }
     
     @Override
-    public PositionInterval next() throws IOException {
+    public Interval next() throws IOException {
       sloppyGroupInterval.begin = Integer.MAX_VALUE;
       sloppyGroupInterval.end = Integer.MIN_VALUE;
       if (!initialized) {
@@ -157,7 +156,7 @@ public class MaxLengthPositionIntervalIt
         
         currentIndex = 0;
         for (int i = 0; i < offsets.length; i++) {
-          PositionInterval current;
+          Interval current;
           if ((current = groupIterator.next()) != null) {
             intervalPositions[i].copy(current);
 
@@ -172,7 +171,7 @@ public class MaxLengthPositionIntervalIt
         sloppyGroupInterval.offsetEnd = intervalPositions[intervalPositions.length-1].offsetEnd;
         return sloppyGroupInterval;
       }
-      PositionInterval current;
+      Interval current;
       if ((current = groupIterator.next()) != null) {
         final int currentFirst = currentIndex++ % intervalPositions.length;
         intervalPositions[currentFirst].copy(current);
@@ -191,7 +190,7 @@ public class MaxLengthPositionIntervalIt
     }
     
     @Override
-    public void collect(PositionCollector collector) {
+    public void collect(IntervalCollector collector) {
       int currentIdx = currentIndex+1;
       for (int i = 0; i < intervalPositions.length; i++) { // find min / max
         int idx = currentIdx++ % intervalPositions.length;
@@ -202,8 +201,8 @@ public class MaxLengthPositionIntervalIt
     }
     
     @Override
-    public PositionIntervalIterator[] subs(boolean inOrder) {
-      return new PositionIntervalIterator[] {groupIterator};
+    public IntervalIterator[] subs(boolean inOrder) {
+      return new IntervalIterator[] {groupIterator};
     }
 
     @Override
@@ -214,14 +213,14 @@ public class MaxLengthPositionIntervalIt
   }
   
   @Override
-  public void collect(PositionCollector collector) {
+  public void collect(IntervalCollector collector) {
     assert collectPositions;
     this.iterator.collect(collector);
     
   }
   
   @Override
-  public PositionIntervalIterator[] subs(boolean inOrder) {
+  public IntervalIterator[] subs(boolean inOrder) {
     return null;
   }
 }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/TermIntervalIterator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/TermIntervalIterator.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/TermIntervalIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/TermIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -27,8 +27,8 @@ import org.apache.lucene.util.BytesRef;
  * 
  */
 //nocommmit javadocs
-public final class TermIntervalIterator extends PositionIntervalIterator {
-  private final PositionInterval interval;
+public final class TermIntervalIterator extends IntervalIterator {
+  private final Interval interval;
   int positionsPending;
   private final DocsAndPositionsEnum docsAndPos;
   private int docID = -1;
@@ -37,11 +37,11 @@ public final class TermIntervalIterator 
     super(scorer, collectPositions);
     this.docsAndPos = docsAndPos;
     this.interval = doPayloads ? new PayloadPosInterval(docsAndPos, this)
-        : new PositionInterval();
+        : new Interval();
   }
 
   @Override
-  public PositionInterval next() throws IOException {
+  public Interval next() throws IOException {
     if (--positionsPending >= 0) {
       interval.begin = interval.end = docsAndPos.nextPosition();
       interval.offsetBegin = docsAndPos.startOffset();
@@ -58,12 +58,12 @@ public final class TermIntervalIterator 
   }
 
   @Override
-  public PositionIntervalIterator[] subs(boolean inOrder) {
+  public IntervalIterator[] subs(boolean inOrder) {
     return EMPTY;
   }
 
   @Override
-  public void collect(PositionCollector collector) {
+  public void collect(IntervalCollector collector) {
     collector.collectLeafPosition(scorer, interval, docID);
   }
 
@@ -88,7 +88,7 @@ public final class TermIntervalIterator 
     return 0;
   }
   
-  private static final class PayloadPosInterval extends PositionInterval {
+  private static final class PayloadPosInterval extends Interval {
     private int pos = -1;
     private final DocsAndPositionsEnum payloads;
     private final TermIntervalIterator termPos;

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinIntervalIterator.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinPositionIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinPositionIterator.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinPositionIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -17,28 +17,28 @@ package org.apache.lucene.search.positio
  */
 import java.io.IOException;
 
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionIntervalFilter;
+import org.apache.lucene.search.positions.IntervalIterator.IntervalFilter;
 
 
 /**
  * @lucene.experimental
  */ // nocommit - javadoc
-public class WithinPositionIterator extends PositionIntervalIterator implements PositionIntervalFilter {
+public class WithinIntervalIterator extends IntervalIterator implements IntervalFilter {
   private int howMany;
-  private PositionIntervalIterator iterator;
-  private PositionInterval interval;
+  private IntervalIterator iterator;
+  private Interval interval;
   
-  public WithinPositionIterator(int howMany, PositionIntervalIterator iterator) {
+  public WithinIntervalIterator(int howMany, IntervalIterator iterator) {
     super(iterator != null ? iterator.scorer : null, iterator != null ? iterator.collectPositions : false);
     this.howMany = howMany;
     this.iterator = iterator;
   }
   
-  public WithinPositionIterator(int howMany) {
+  public WithinIntervalIterator(int howMany) {
     this(howMany, null); // use this instance as a filter template
   }
   @Override
-  public PositionInterval next() throws IOException {
+  public Interval next() throws IOException {
     while ((interval = iterator.next()) != null) {
       if((iterator.matchDistance()) <= howMany){
         return interval;
@@ -48,16 +48,16 @@ public class WithinPositionIterator exte
   }
 
   @Override
-  public PositionIntervalIterator[] subs(boolean inOrder) {
-    return new PositionIntervalIterator[] {iterator};
+  public IntervalIterator[] subs(boolean inOrder) {
+    return new IntervalIterator[] {iterator};
   }
 
-  public PositionIntervalIterator filter(PositionIntervalIterator iter) {
-    return new WithinPositionIterator(howMany, iter);
+  public IntervalIterator filter(IntervalIterator iter) {
+    return new WithinIntervalIterator(howMany, iter);
   }
 
   @Override
-  public void collect(PositionCollector collector) {
+  public void collect(IntervalCollector collector) {
     assert collectPositions;
     collector.collectComposite(null, interval, iterator.docID());
     iterator.collect(collector);

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinOrderedFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinOrderedFilter.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinOrderedFilter.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/positions/WithinOrderedFilter.java Thu Jul 19 02:01:47 2012
@@ -17,7 +17,7 @@ package org.apache.lucene.search.positio
  * limitations under the License.
  */
 
-public class WithinOrderedFilter implements PositionIntervalIterator.PositionIntervalFilter {
+public class WithinOrderedFilter implements IntervalIterator.IntervalFilter {
 
   private int slop;
 
@@ -26,9 +26,9 @@ public class WithinOrderedFilter impleme
   }
 
   @Override
-  public PositionIntervalIterator filter(PositionIntervalIterator iter) {
-    return new WithinPositionIterator(slop,
-        new OrderedConjunctionPositionIterator(false, iter));
+  public IntervalIterator filter(IntervalIterator iter) {
+    return new WithinIntervalIterator(slop,
+        new OrderedConjunctionIntervalIterator(false, iter));
   }
 
   @Override

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpanScorer.java Thu Jul 19 02:01:47 2012
@@ -21,7 +21,7 @@ import java.io.IOException;
 
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.search.similarities.Similarity;
 
 /**
@@ -100,7 +100,7 @@ public class SpanScorer extends Scorer {
   }
 
   @Override
-  public PositionIntervalIterator positions(boolean needsPayloads,
+  public IntervalIterator positions(boolean needsPayloads,
       boolean needsOffsets, boolean collectPositions) throws IOException {
     return null;
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpansScorerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpansScorerWrapper.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpansScorerWrapper.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/java/org/apache/lucene/search/spans/SpansScorerWrapper.java Thu Jul 19 02:01:47 2012
@@ -20,18 +20,18 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 
-import org.apache.lucene.search.positions.PositionIntervalIterator;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
+import org.apache.lucene.search.positions.IntervalIterator;
+import org.apache.lucene.search.positions.Interval;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.util.BytesRef;
 
 public class SpansScorerWrapper extends Spans {
   private final Scorer scorer;
-  private final PositionIntervalIterator positions;
-  private PositionInterval current;
+  private final IntervalIterator positions;
+  private Interval current;
   private int doc = -1;
 
-  public SpansScorerWrapper(Scorer scorer, PositionIntervalIterator positions) {
+  public SpansScorerWrapper(Scorer scorer, IntervalIterator positions) {
     this.scorer = scorer;
     this.positions = positions;
   }
@@ -103,7 +103,7 @@ public class SpansScorerWrapper extends 
     return current != null && current.payloadAvailable();
   }
 
-  public PositionInterval current() {
+  public Interval current() {
     return current;
   }
 

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java Thu Jul 19 02:01:47 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.search;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.Norm;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
@@ -203,7 +203,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public PositionIntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
+    public IntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
     
@@ -250,7 +250,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public PositionIntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
+    public IntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java Thu Jul 19 02:01:47 2012
@@ -34,9 +34,9 @@ import org.apache.lucene.index.MultiRead
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.positions.PositionFilterQuery;
-import org.apache.lucene.search.positions.RangePositionsIterator;
-import org.apache.lucene.search.positions.WithinPositionIterator;
+import org.apache.lucene.search.positions.IntervalFilterQuery;
+import org.apache.lucene.search.positions.RangeIntervalIterator;
+import org.apache.lucene.search.positions.WithinIntervalIterator;
 import org.apache.lucene.search.similarities.DefaultSimilarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
@@ -323,14 +323,14 @@ public class TestBooleanQuery extends Lu
      query.add(new BooleanClause(new TermQuery(new Term("field", "hot!")), Occur.MUST));
      
      {
-       PositionFilterQuery filter = new PositionFilterQuery(query, new RangePositionsIterator(0,3));
+       IntervalFilterQuery filter = new IntervalFilterQuery(query, new RangeIntervalIterator(0,3));
        TopDocs search = searcher.search(filter, 10);
        ScoreDoc[] scoreDocs = search.scoreDocs;
        assertEquals(1, search.totalHits);
        assertEquals(0, scoreDocs[0].doc);
      }
      {
-       PositionFilterQuery filter = new PositionFilterQuery(query, new WithinPositionIterator(3));
+       IntervalFilterQuery filter = new IntervalFilterQuery(query, new WithinIntervalIterator(3));
        TopDocs search = searcher.search(filter, 10);
        ScoreDoc[] scoreDocs = search.scoreDocs;
        assertEquals(2, search.totalHits);

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java Thu Jul 19 02:01:47 2012
@@ -30,7 +30,7 @@ import org.apache.lucene.index.IndexRead
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanQuery.BooleanWeight;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -93,7 +93,7 @@ public class TestBooleanScorer extends L
         return doc = target <= 3000 ? 3000 : NO_MORE_DOCS;
       }
       @Override
-      public PositionIntervalIterator positions(boolean needsPayloads,
+      public IntervalIterator positions(boolean needsPayloads,
           boolean needsOffsets, boolean collectPositions) throws IOException {
         return null;
       }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestCachingCollector.java Thu Jul 19 02:01:47 2012
@@ -18,7 +18,7 @@ package org.apache.lucene.search;
  */
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
@@ -46,8 +46,8 @@ public class TestCachingCollector extend
     public int advance(int target) throws IOException { return 0; }
 
     @Override
-    public PositionIntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
-      return PositionIntervalIterator.NO_MORE_POSITIONS;
+    public IntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
+      return IntervalIterator.NO_MORE_POSITIONS;
     }
     
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java Thu Jul 19 02:01:47 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.search;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -51,7 +51,7 @@ public class TestPositiveScoresOnlyColle
     }
 
     @Override
-    public PositionIntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
+    public IntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
       throw new UnsupportedOperationException();
     }
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java Thu Jul 19 02:01:47 2012
@@ -21,7 +21,7 @@ import org.apache.lucene.index.AtomicRea
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -57,7 +57,7 @@ public class TestScoreCachingWrappingSco
     }
 
     @Override
-    public PositionIntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
+    public IntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
       throw new UnsupportedOperationException(); 
     }
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java Thu Jul 19 02:01:47 2012
@@ -23,8 +23,8 @@ import org.apache.lucene.analysis.MockTo
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.*;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
+import org.apache.lucene.search.positions.IntervalIterator;
+import org.apache.lucene.search.positions.Interval;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -81,12 +81,12 @@ public class TestTermQuery extends Lucen
         assertNotNull(scorer);
         int toDoc = 1 + random().nextInt(atomicReaderContext.reader().docFreq(new Term(fieldName, "1")) - 1 );
         final int advance = scorer.advance(toDoc);
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
 
         do {
           assertEquals(scorer.docID(), positions.advanceTo(scorer.docID()));
 
-          PositionInterval interval = null;
+          Interval interval = null;
           String msg = "Advanced to: " + advance + " current doc: "
               + scorer.docID() + " usePayloads: " + payloadsIndexed;
           assertNotNull(msg, (interval = positions.next()));
@@ -122,7 +122,7 @@ public class TestTermQuery extends Lucen
     directory.close();
   }
 
-  public final void checkPayload(int pos, PositionInterval interval,
+  public final void checkPayload(int pos, Interval interval,
       boolean payloadsIndexed) throws IOException {
     if (payloadsIndexed) {
       boolean wasPayloadAvailable = interval.payloadAvailable();
@@ -197,7 +197,7 @@ public class TestTermQuery extends Lucen
           if (docID == Scorer.NO_MORE_DOCS) {
             break;
           }
-          PositionIntervalIterator positions = scorer.positions(false, false, false);
+          IntervalIterator positions = scorer.positions(false, false, false);
           Integer[] pos = positionsInDoc[atomicReaderContext.docBase + docID];
 
           assertEquals((float) pos.length, positions.getScorer().freq(), 0.0f);
@@ -205,7 +205,7 @@ public class TestTermQuery extends Lucen
           // allways
           final int howMany = random().nextInt(20) == 0 ? pos.length
               - random().nextInt(pos.length) : pos.length;
-          PositionInterval interval = null;
+          Interval interval = null;
           assertEquals(scorer.docID(), positions.advanceTo(scorer.docID()));
           for (int j = 0; j < howMany; j++) {
             assertNotNull((interval = positions.next()));
@@ -265,7 +265,7 @@ public class TestTermQuery extends Lucen
       IndexReaderContext topReaderContext = reader.getTopReaderContext();
       List<AtomicReaderContext> leaves = topReaderContext.leaves();
       Weight weight = one.createWeight(searcher);
-      PositionInterval interval = null;
+      Interval interval = null;
       for (AtomicReaderContext atomicReaderContext : leaves) {
         Scorer scorer = weight.scorer(atomicReaderContext, true, true, null);
         assertNotNull(scorer);
@@ -279,7 +279,7 @@ public class TestTermQuery extends Lucen
           initDoc = scorer.advance(random().nextInt(maxDoc));
         }
         String msg = "Iteration: " + i + " initDoc: " + initDoc;
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
         assertEquals(howMany / 2.f, positions.getScorer().freq(), 0.0);
         assertEquals(scorer.docID(), positions.advanceTo(scorer.docID()));
         for (int j = 0; j < howMany; j += 2) {

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBasicIntervals.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestSimplePositions.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBasicIntervals.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBasicIntervals.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestSimplePositions.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestSimplePositions.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBasicIntervals.java Thu Jul 19 02:01:47 2012
@@ -26,14 +26,13 @@ import org.apache.lucene.index.RandomInd
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionIntervalFilter;
+import org.apache.lucene.search.positions.IntervalIterator.IntervalFilter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 
-public class TestSimplePositions extends LuceneTestCase {
+public class TestBasicIntervals extends LuceneTestCase {
   private IndexSearcher searcher;
   private IndexReader reader;
   private Directory directory;
@@ -93,7 +92,7 @@ public class TestSimplePositions extends
     query.add(q1, Occur.MUST);
     query.add(q2, Occur.MUST);
     query.add(q3, Occur.MUST);
-    Query snq = new PositionFilterQuery(query, new WithinOrderedFilter(slop));
+    Query snq = new IntervalFilterQuery(query, new WithinOrderedFilter(slop));
     checkHits(snq, expectedDocs);
   }
   
@@ -178,7 +177,7 @@ public class TestSimplePositions extends
    Occur.MUST));
    query.add(new BooleanClause(new TermQuery(new Term(field, "t3")),
    Occur.MUST));
-   PositionFilterQuery positionFilterQuery = new PositionFilterQuery( query, new WithinOrderedFilter(3));
+   IntervalFilterQuery positionFilterQuery = new IntervalFilterQuery( query, new WithinOrderedFilter(3));
    
    Query rewrite = this.searcher.rewrite(positionFilterQuery);
    AtomicReader r = this.reader.getTopReaderContext().leaves().get(0).reader();
@@ -186,9 +185,9 @@ public class TestSimplePositions extends
    
    Scorer scorer = createWeight.scorer(r.getTopReaderContext(), random()
        .nextBoolean(), true, r.getLiveDocs());
-   PositionIntervalIterator positions = scorer.positions(false, false, false);
+   IntervalIterator positions = scorer.positions(false, false, false);
    positions.advanceTo(11);
-   PositionInterval interval = positions.next();
+   Interval interval = positions.next();
    assertNotNull("first range", interval);
    assertEquals("first doc", 11, positions.docID());
    assertEquals("first start", 0, interval.begin);
@@ -204,11 +203,11 @@ public class TestSimplePositions extends
    assertNull("third range", positions.next());
    }
 
-  public static class BlockPositionIteratorFilter implements PositionIntervalFilter {
+  public static class BlockPositionIteratorFilter implements IntervalFilter {
 
     @Override
-    public PositionIntervalIterator filter(PositionIntervalIterator iter) {
-      return new BlockPositionIterator(false, iter);
+    public IntervalIterator filter(IntervalIterator iter) {
+      return new BlockIntervalIterator(false, iter);
     }
     
   }
@@ -217,7 +216,7 @@ public class TestSimplePositions extends
       BooleanQuery query = new BooleanQuery();
       query.add(makeTermQuery("u1"), Occur.MUST);
       query.add(makeTermQuery("u2"), Occur.MUST);
-      Query snq = new PositionFilterQuery(query, new WithinPositionIterator(
+      Query snq = new IntervalFilterQuery(query, new WithinIntervalIterator(
           0));
       Query rewrite = this.searcher.rewrite(snq);
       AtomicReader r = this.reader.getTopReaderContext().leaves().get(0).reader();
@@ -225,9 +224,9 @@ public class TestSimplePositions extends
       
       Scorer scorer = createWeight.scorer(r.getTopReaderContext(), random()
           .nextBoolean(), true, r.getLiveDocs());
-      PositionIntervalIterator positions = scorer.positions(false, false, false);
+      IntervalIterator positions = scorer.positions(false, false, false);
       positions.advanceTo(4);
-      PositionInterval interval = positions.next();
+      Interval interval = positions.next();
       assertNotNull("Does not have next and it should", interval);
       assertEquals("doc", 4, positions.docID());
       assertEquals("start " + interval, 1, interval.begin);
@@ -270,24 +269,24 @@ public class TestSimplePositions extends
       BooleanQuery query = new BooleanQuery();
       query.add(makeTermQuery("u1"), Occur.MUST);
       query.add(makeTermQuery("u2"), Occur.MUST);
-      Query nearQuery = new PositionFilterQuery(query,
-          new WithinPositionIterator(0));
+      Query nearQuery = new IntervalFilterQuery(query,
+          new WithinIntervalIterator(0));
       
       BooleanQuery topLevel = new BooleanQuery();
       topLevel.add(nearQuery, Occur.MUST);
       topLevel.add(makeTermQuery("u2"), Occur.MUST);
 
 
-      Query rewrite = this.searcher.rewrite(new PositionFilterQuery(topLevel,
-          new WithinPositionIterator(1)));
+      Query rewrite = this.searcher.rewrite(new IntervalFilterQuery(topLevel,
+          new WithinIntervalIterator(1)));
       AtomicReader r = this.reader.getTopReaderContext().leaves().get(0).reader();
       Weight createWeight = rewrite.createWeight(new IndexSearcher(r));
       Scorer scorer = createWeight.scorer(r.getTopReaderContext(), random()
           .nextBoolean(), true, r.getLiveDocs());
       
-      PositionIntervalIterator iterator = scorer.positions(false, false, false);
+      IntervalIterator iterator = scorer.positions(false, false, false);
       assertEquals(4,iterator.advanceTo(4));
-      PositionInterval interval = iterator.next();
+      Interval interval = iterator.next();
       assertNotNull("Does not have next and it should", interval);
       assertEquals("doc", 4, iterator.docID());
       assertEquals("start", 0, interval.begin);
@@ -354,7 +353,7 @@ public class TestSimplePositions extends
     }
   }
   
-  private PositionIntervalIterator orIterator(String[] terms) throws Exception {
+  private IntervalIterator orIterator(String[] terms) throws Exception {
     BooleanQuery query = new BooleanQuery();
     
     for (int i = 0; i < terms.length; i++) {
@@ -369,14 +368,14 @@ public class TestSimplePositions extends
     return scorer.positions(false, false, false);
   }
   
-  private PositionIntervalIterator tstNextPosition(
-      PositionIntervalIterator iterator, int doc, int start, int end)
+  private IntervalIterator tstNextPosition(
+      IntervalIterator iterator, int doc, int start, int end)
       throws Exception {
     if (iterator.docID() != doc) {
       iterator.advanceTo(doc);
     }
     assertEquals("doc", doc, iterator.docID());
-    PositionInterval next = iterator.next();
+    Interval next = iterator.next();
     assertNotNull("next", next);
     assertEquals("begin", start, next.begin);
     assertEquals("end", end, next.end + 1);
@@ -384,13 +383,13 @@ public class TestSimplePositions extends
   }
   
   public void testOrSingle() throws Exception {
-    PositionIntervalIterator spans = orIterator(new String[] {"w5"});
+    IntervalIterator spans = orIterator(new String[] {"w5"});
     tstNextPosition(spans, 0, 4, 5);
     assertNull("final next", spans.next());
   }
   
   public void testOrMovesForward() throws Exception {
-    PositionIntervalIterator iterator = orIterator(new String[] {"w1", "xx"});
+    IntervalIterator iterator = orIterator(new String[] {"w1", "xx"});
     iterator.advanceTo(0);
     assertNotNull(iterator.next());
     int doc = iterator.docID();
@@ -400,7 +399,7 @@ public class TestSimplePositions extends
   }
   
   public void testSpanOrDouble() throws Exception {
-    PositionIntervalIterator iterator = orIterator(new String[] {"w5", "yy"});
+    IntervalIterator iterator = orIterator(new String[] {"w5", "yy"});
     tstNextPosition(iterator, 0, 4, 5);
     tstNextPosition(iterator, 2, 3, 4);
     tstNextPosition(iterator, 3, 4, 5);
@@ -409,10 +408,10 @@ public class TestSimplePositions extends
   }
   
   public void testOrDoubleSkip() throws Exception {
-    PositionIntervalIterator iterator = orIterator(new String[] {"w5", "yy"});
+    IntervalIterator iterator = orIterator(new String[] {"w5", "yy"});
     assertEquals("initial skipTo", 3, iterator.advanceTo(3));
     assertEquals("doc", 3, iterator.docID());
-    PositionInterval next = iterator.next();
+    Interval next = iterator.next();
     assertEquals("start", 4, next.begin);
     assertEquals("end", 4, next.end);
     tstNextPosition(iterator, 7, 3, 4);
@@ -420,7 +419,7 @@ public class TestSimplePositions extends
   }
   
   public void testOrUnused() throws Exception {
-    PositionIntervalIterator iterator = orIterator(new String[] {"w5",
+    IntervalIterator iterator = orIterator(new String[] {"w5",
         "unusedTerm", "yy"});
     tstNextPosition(iterator, 0, 4, 5);
     tstNextPosition(iterator, 2, 3, 4);
@@ -430,7 +429,7 @@ public class TestSimplePositions extends
   }
   
   public void testOrTripleSameDoc() throws Exception {
-    PositionIntervalIterator iterator = orIterator(new String[] {"t1", "t2",
+    IntervalIterator iterator = orIterator(new String[] {"t1", "t2",
         "t3"});
     tstNextPosition(iterator, 11, 0, 1);
     tstNextPosition(iterator, 11, 1, 2);

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockIntervalIterator.java (from r1363191, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockPositionsIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockPositionsIterator.java&r1=1363191&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockPositionsIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBlockIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -21,15 +21,14 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionIntervalFilter;
+import org.apache.lucene.search.positions.IntervalIterator.IntervalFilter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.util.List;
 
-public class TestBlockPositionsIterator extends LuceneTestCase {
+public class TestBlockIntervalIterator extends LuceneTestCase {
   
   private static final void addDocs(RandomIndexWriter writer) throws CorruptIndexException, IOException {
     {
@@ -65,7 +64,7 @@ public class TestBlockPositionsIterator 
     query.add(new BooleanClause(new TermQuery(new Term("field", "porridge")), Occur.MUST));
     query.add(new BooleanClause(new TermQuery(new Term("field", "hot!")), Occur.MUST));
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new BlockPositionIteratorFilter());
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new BlockPositionIteratorFilter());
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(2, search.totalHits);
@@ -77,7 +76,7 @@ public class TestBlockPositionsIterator 
     query.add(new BooleanClause(new TermQuery(new Term("field", "cold!")), Occur.MUST));
     
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new BlockPositionIteratorFilter());
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new BlockPositionIteratorFilter());
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(1, search.totalHits);
@@ -88,7 +87,7 @@ public class TestBlockPositionsIterator 
     query.add(new BooleanClause(new TermQuery(new Term("field", "pease")), Occur.MUST));
     query.add(new BooleanClause(new TermQuery(new Term("field", "hot!")), Occur.MUST));
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new BlockPositionIteratorFilter());
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new BlockPositionIteratorFilter());
       TopDocs search = searcher.search(filter, 10);
       assertEquals(0, search.totalHits);
     }
@@ -118,9 +117,9 @@ public class TestBlockPositionsIterator 
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(0, nextDoc);
-        PositionIntervalIterator positions = new BlockPositionIterator(false, scorer.positions(false, false, false));
+        IntervalIterator positions = new BlockIntervalIterator(false, scorer.positions(false, false, false));
         assertEquals(0, positions.advanceTo(0));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {0, 31};
         int[] end = new int[] {2, 33};
         // {start}term{end} - end is pos+1 
@@ -137,9 +136,9 @@ public class TestBlockPositionsIterator 
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(1, nextDoc);
-        PositionIntervalIterator positions =  new BlockPositionIterator(false, scorer.positions(false, false, false));
+        IntervalIterator positions =  new BlockIntervalIterator(false, scorer.positions(false, false, false));
         assertEquals(1, positions.advanceTo(1));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {3, 34};
         int[] end = new int[] {5, 36};
         // {start}term{end} - end is pos+1
@@ -161,11 +160,11 @@ public class TestBlockPositionsIterator 
   }
   
   
-  public static class BlockPositionIteratorFilter implements PositionIntervalFilter {
+  public static class BlockPositionIteratorFilter implements IntervalFilter {
 
     @Override
-    public PositionIntervalIterator filter(PositionIntervalIterator iter) {
-      return new BlockPositionIterator(false, iter);
+    public IntervalIterator filter(IntervalIterator iter) {
+      return new BlockIntervalIterator(false, iter);
     }
     
   }

Modified: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBrouwerianQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBrouwerianQuery.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBrouwerianQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestBrouwerianQuery.java Thu Jul 19 02:01:47 2012
@@ -36,7 +36,6 @@ import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.Weight;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -138,9 +137,9 @@ public class TestBrouwerianQuery extends
       Scorer scorer = weight.scorer(atomicReaderContext, true, true, atomicReaderContext.reader().getLiveDocs());
         int nextDoc = scorer.nextDoc();
         assertEquals(1, nextDoc);
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
         assertEquals(1, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {0, 1, 4};
         int[] end = new int[] {4, 6, 11};
         for (int j = 0; j < end.length; j++) {

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionIntervalIterator.java (from r1363191, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionPositionsIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionPositionsIterator.java&r1=1363191&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionPositionsIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestConjunctionIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -21,14 +21,13 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.util.List;
 
-public class TestConjunctionPositionsIterator extends LuceneTestCase {
+public class TestConjunctionIntervalIterator extends LuceneTestCase {
   
   private static final void addDocs(RandomIndexWriter writer) throws CorruptIndexException, IOException {
     {
@@ -65,14 +64,14 @@ public class TestConjunctionPositionsIte
     query.add(new BooleanClause(new TermQuery(new Term("field", "pease")), Occur.MUST));
     query.add(new BooleanClause(new TermQuery(new Term("field", "hot!")), Occur.MUST));
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new RangePositionsIterator(0,3));
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new RangeIntervalIterator(0,3));
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(1, search.totalHits);
       assertEquals(0, scoreDocs[0].doc);
     }
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new WithinPositionIterator(3));
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new WithinIntervalIterator(3));
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(2, search.totalHits);
@@ -106,9 +105,9 @@ public class TestConjunctionPositionsIte
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(0, nextDoc);
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
         assertEquals(0, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {0, 1, 2, 3, 4, 6, 7, 31, 32, 33};
         int[] end = new int[] {2, 3, 4, 33, 33, 33, 33, 33, 34, 35};
         // {start}term{end} - end is pos+1 
@@ -125,9 +124,9 @@ public class TestConjunctionPositionsIte
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(1, nextDoc);
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
         assertEquals(1, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {0, 1, 3, 4, 5, 6, 7, 31, 32, 34 };
         int[] end = new int[] {5, 5, 5, 6, 7, 36, 36, 36, 36, 36 };
         // {start}term{end} - end is pos+1

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionIntervalIterator.java (from r1363191, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionPositionIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionPositionIterator.java&r1=1363191&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionPositionIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestDisjunctionIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -6,14 +6,13 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.util.List;
 
-public class TestDisjunctionPositionIterator extends LuceneTestCase {
+public class TestDisjunctionIntervalIterator extends LuceneTestCase {
   private static final void addDocs(RandomIndexWriter writer)
       throws CorruptIndexException, IOException {
     {
@@ -54,16 +53,16 @@ public class TestDisjunctionPositionIter
     query.add(new BooleanClause(new TermQuery(new Term("field", "hot!")),
         Occur.SHOULD));
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query,
-          new RangePositionsIterator(0, 3));
+      IntervalFilterQuery filter = new IntervalFilterQuery(query,
+          new RangeIntervalIterator(0, 3));
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(2, search.totalHits);
       assertEquals(0, scoreDocs[0].doc);
     }
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query,
-          new WithinPositionIterator(3));
+      IntervalFilterQuery filter = new IntervalFilterQuery(query,
+          new WithinIntervalIterator(3));
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(2, search.totalHits);
@@ -111,9 +110,9 @@ public class TestDisjunctionPositionIter
 
       int nextDoc = scorer.nextDoc();
       assertEquals(i, nextDoc);
-      PositionIntervalIterator positions = scorer.positions(false, false, false);
+      IntervalIterator positions = scorer.positions(false, false, false);
       assertEquals(i, positions.advanceTo(nextDoc));
-      PositionInterval interval = positions.next();
+      Interval interval = positions.next();
       assertEquals(1, interval.begin);
       assertEquals(1, interval.end);
 
@@ -165,9 +164,9 @@ public class TestDisjunctionPositionIter
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(0, nextDoc);
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
         assertEquals(0, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] { 0, 1, 2, 3, 4, 6, 7, 31, 32, 33 };
         int[] end = new int[] { 2, 3, 4, 33, 33, 33, 33, 33, 34, 35 };
         // {start}term{end} - end is pos+1
@@ -187,9 +186,9 @@ public class TestDisjunctionPositionIter
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(1, nextDoc);
-        PositionIntervalIterator positions = scorer.positions(false, false, false);
+        IntervalIterator positions = scorer.positions(false, false, false);
         assertEquals(1, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] { 0, 1, 3, 4, 5, 6, 7, 31, 32, 34 };
         int[] end = new int[] { 5, 5, 5, 6, 7, 36, 36, 36, 36, 36 };
         // {start}term{end} - end is pos+1

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestIntervalFilterQueries.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionFilterQueries.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestIntervalFilterQueries.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestIntervalFilterQueries.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionFilterQueries.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionFilterQueries.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestIntervalFilterQueries.java Thu Jul 19 02:01:47 2012
@@ -29,7 +29,7 @@ import org.apache.lucene.util.LuceneTest
 
 import java.io.IOException;
 
-public class TestPositionFilterQueries extends LuceneTestCase {
+public class TestIntervalFilterQueries extends LuceneTestCase {
 
   private IndexSearcher searcher;
   private IndexReader reader;

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionIntervalIterator.java (from r1363191, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionPositionsIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionPositionsIterator.java&r1=1363191&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionPositionsIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestOrderedConjunctionIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -6,15 +6,14 @@ import org.apache.lucene.document.TextFi
 import org.apache.lucene.index.*;
 import org.apache.lucene.search.*;
 import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionIntervalFilter;
+import org.apache.lucene.search.positions.IntervalIterator.IntervalFilter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 
 import java.io.IOException;
 import java.util.List;
 
-public class TestOrderedConjunctionPositionsIterator extends LuceneTestCase {
+public class TestOrderedConjunctionIntervalIterator extends LuceneTestCase {
   
   private static final void addDocs(RandomIndexWriter writer) throws CorruptIndexException, IOException {
     {
@@ -60,7 +59,7 @@ public class TestOrderedConjunctionPosit
     query.add(new BooleanClause(new TermQuery(new Term("field", "pease")), Occur.MUST));
     query.add(new BooleanClause(new TermQuery(new Term("field", "porridge")), Occur.MUST));
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new OrderedConjunctionPositionIteratorFilter());
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new OrderedConjunctionPositionIteratorFilter());
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(3, search.totalHits);
@@ -76,7 +75,7 @@ public class TestOrderedConjunctionPosit
     query.add(new BooleanClause(new TermQuery(new Term("field", "cold!")), Occur.MUST));
 
     {
-      PositionFilterQuery filter = new PositionFilterQuery(query, new OrderedConjunctionPositionIteratorFilter());
+      IntervalFilterQuery filter = new IntervalFilterQuery(query, new OrderedConjunctionPositionIteratorFilter());
       TopDocs search = searcher.search(filter, 10);
       ScoreDoc[] scoreDocs = search.scoreDocs;
       assertEquals(2, search.totalHits);
@@ -112,9 +111,9 @@ public class TestOrderedConjunctionPosit
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(0, nextDoc);
-        PositionIntervalIterator positions = new OrderedConjunctionPositionIterator(false, scorer.positions(false, false, false));
+        IntervalIterator positions = new OrderedConjunctionIntervalIterator(false, scorer.positions(false, false, false));
         assertEquals(0, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {0, 31};
         int[] end = new int[] {2, 33};
         // {start}term{end} - end is pos+1 
@@ -133,9 +132,9 @@ public class TestOrderedConjunctionPosit
       {
         int nextDoc = scorer.nextDoc();
         assertEquals(1, nextDoc);
-        PositionIntervalIterator positions = new OrderedConjunctionPositionIterator(false, scorer.positions(false, false, false));
+        IntervalIterator positions = new OrderedConjunctionIntervalIterator(false, scorer.positions(false, false, false));
         assertEquals(1, positions.advanceTo(nextDoc));
-        PositionInterval interval = null;
+        Interval interval = null;
         int[] start = new int[] {3, 34};
         int[] end = new int[] {5, 36};
         // {start}term{end} - end is pos+1
@@ -154,11 +153,11 @@ public class TestOrderedConjunctionPosit
     directory.close();
   }
   
-  public static class OrderedConjunctionPositionIteratorFilter implements PositionIntervalFilter {
+  public static class OrderedConjunctionPositionIteratorFilter implements IntervalFilter {
 
     @Override
-    public PositionIntervalIterator filter(PositionIntervalIterator iter) {
-      return new OrderedConjunctionPositionIterator(false, iter);
+    public IntervalIterator filter(IntervalIterator iter) {
+      return new OrderedConjunctionIntervalIterator(false, iter);
     }
     
   }

Copied: lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionsAndOffsets.java (from r1363191, lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionOffsets.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionsAndOffsets.java?p2=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionsAndOffsets.java&p1=lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionOffsets.java&r1=1363191&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionOffsets.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/core/src/test/org/apache/lucene/search/positions/TestPositionsAndOffsets.java Thu Jul 19 02:01:47 2012
@@ -34,7 +34,7 @@ import org.apache.lucene.store.Directory
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util._TestUtil;
 
-public class TestPositionOffsets extends LuceneTestCase {
+public class TestPositionsAndOffsets extends LuceneTestCase {
 
   // What am I testing here?
   // - can get offsets out of a basic TermQuery, and a more complex BooleanQuery
@@ -103,13 +103,13 @@ public class TestPositionOffsets extends
 
     int nextDoc = scorer.nextDoc();
     assertEquals(0, nextDoc);
-    PositionIntervalIterator positions = scorer.positions(false, needsOffsets, false);
+    IntervalIterator positions = scorer.positions(false, needsOffsets, false);
     int startOffsets[] = expectedOffsets[0];
     int endOffsets[] = expectedOffsets[1];
 
     assertEquals(0, positions.advanceTo(nextDoc));
     for (int i = 0; i < startOffsets.length; i++) {
-      PositionIntervalIterator.PositionInterval interval = positions.next();
+      Interval interval = positions.next();
       assertEquals("i: " + i, startOffsets[i], interval.offsetBegin);
       assertEquals("i: " + i, endOffsets[i], interval.offsetEnd);
     }

Modified: lucene/dev/branches/LUCENE-2878/lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java?rev=1363203&r1=1363202&r2=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java Thu Jul 19 02:01:47 2012
@@ -34,7 +34,7 @@ import org.apache.lucene.search.TopDocsC
 import org.apache.lucene.search.TopFieldCollector;
 import org.apache.lucene.search.TopScoreDocCollector;
 import org.apache.lucene.search.Weight;
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.PriorityQueue;
 
@@ -126,7 +126,7 @@ public class BlockGroupingCollector exte
     }
 
     @Override
-    public PositionIntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
+    public IntervalIterator positions(boolean needsPayloads, boolean needsOffsets, boolean collectPositions) throws IOException {
       throw new UnsupportedOperationException();
     }
   }

Copied: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/ArrayIntervalIterator.java (from r1363198, lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/poshighlight/PositionIntervalArrayIterator.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/ArrayIntervalIterator.java?p2=lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/ArrayIntervalIterator.java&p1=lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/poshighlight/PositionIntervalArrayIterator.java&r1=1363198&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/poshighlight/PositionIntervalArrayIterator.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/ArrayIntervalIterator.java Thu Jul 19 02:01:47 2012
@@ -1,4 +1,4 @@
-package org.apache.lucene.search.poshighlight;
+package org.apache.lucene.search.highlight.positions;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -19,38 +19,39 @@ package org.apache.lucene.search.poshigh
 
 import java.io.IOException;
 
-import org.apache.lucene.search.positions.PositionIntervalIterator;
+import org.apache.lucene.search.positions.IntervalIterator;
+import org.apache.lucene.search.positions.Interval;
 
 /**
  * Present an array of PositionIntervals as an Iterator.
  * @lucene.experimental
  */
-public class PositionIntervalArrayIterator extends PositionIntervalIterator {
+public class ArrayIntervalIterator extends IntervalIterator {
 
   private int next = 0;
   private int count;
-  private PositionInterval[] positions;
+  private Interval[] positions;
   
-  public PositionIntervalArrayIterator (PositionInterval[] positions, int count) {
+  public ArrayIntervalIterator (Interval[] positions, int count) {
     super(null, false);
     this.positions = positions;
     this.count = count;
   }
   
   @Override
-  public PositionInterval next() {
+  public Interval next() {
     if (next >= count)
       return null;
     return positions[next++];
   }
 
   @Override
-  public PositionIntervalIterator[] subs(boolean inOrder) {
+  public IntervalIterator[] subs(boolean inOrder) {
     return EMPTY;
   }
 
   @Override
-  public void collect(PositionCollector collector) {
+  public void collect(IntervalCollector collector) {
     assert collectPositions;
   }
 

Copied: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/DocAndPositions.java (from r1363191, lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/poshighlight/ScorePosDoc.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/DocAndPositions.java?p2=lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/DocAndPositions.java&p1=lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/poshighlight/ScorePosDoc.java&r1=1363191&r2=1363203&rev=1363203&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/poshighlight/ScorePosDoc.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/positions/DocAndPositions.java Thu Jul 19 02:01:47 2012
@@ -1,4 +1,4 @@
-package org.apache.lucene.search.poshighlight;
+package org.apache.lucene.search.highlight.positions;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,38 +20,38 @@ package org.apache.lucene.search.poshigh
 import java.util.Comparator;
 
 import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.positions.PositionIntervalIterator.PositionInterval;
+import org.apache.lucene.search.positions.Interval;
 import org.apache.lucene.util.ArrayUtil;
 
 /** Used to accumulate position intervals while scoring 
  * @lucene.experimental
  */
-public class ScorePosDoc extends ScoreDoc {
+public final class DocAndPositions extends ScoreDoc {
   
   public int posCount = 0;
-  public PositionInterval[] positions;
+  public Interval[] positions;
   
-  public ScorePosDoc(int doc) {
+  public DocAndPositions(int doc) {
     super(doc, 0);
-    positions = new PositionInterval[32];
+    positions = new Interval[32];
   }
   
-  public void storePosition (PositionInterval pos) {
+  public void storePosition (Interval pos) {
     ensureStorage();
-    positions[posCount++] = (PositionInterval) pos.clone();
+    positions[posCount++] = (Interval) pos.clone();
   }
   
   private void ensureStorage () {
     if (posCount >= positions.length) {
-      PositionInterval temp[] = new PositionInterval[positions.length * 2];
+      Interval temp[] = new Interval[positions.length * 2];
       System.arraycopy(positions, 0, temp, 0, positions.length);
       positions = temp;
     }
   }
   
-  public PositionInterval[] sortedPositions() {
-    ArrayUtil.mergeSort(positions, 0, posCount, new Comparator<PositionInterval>() {
-      public int compare(PositionInterval o1, PositionInterval o2) {
+  public Interval[] sortedPositions() {
+    ArrayUtil.mergeSort(positions, 0, posCount, new Comparator<Interval>() {
+      public int compare(Interval o1, Interval o2) {
         return 
           o1.begin < o2.begin ? -1 : 
             (o1.begin > o2.begin ? 1 :



Mime
View raw message