package edu.umass.cs.ciir.waltz.index;

import edu.umass.cs.ciir.waltz.dociter.movement.PostingMover;
import edu.umass.cs.ciir.waltz.feature.Feature;
import edu.umass.cs.ciir.waltz.postings.positions.PositionsList;

import java.io.Closeable;
import java.util.List;

/**
 * @author jfoley
 */
public interface Index extends Closeable {
  // TODO longs here?
  int getCollectionLength();

  int getDocumentCount();

  List<Integer> getAllDocumentIds();

  PostingMover<Integer> getCountsMover(String term);

  PostingMover<PositionsList> getPositionsMover(String term);

  Feature<Integer> getCounts(String term);

  Feature<PositionsList> getPositions(String term);

  String getDocumentName(int id);
  int getDocumentId(String documentName);

  Feature<Integer> getLengths();

}

@@ -209,16 +209,83 @@
 sList;%0A%0A
+import javax.annotation.Nonnull;%0Aimport javax.annotation.Nullable;%0A
 import j
@@ -298,24 +298,24 @@
 .Closeable;%0A
-
 import java.
@@ -474,16 +474,27 @@
 unt();%0A%0A
+  @Nonnull%0A
   List%3CI
@@ -519,24 +519,36 @@
 mentIds();%0A%0A
+  @Nullable%0A
   PostingMov
@@ -589,16 +589,28 @@
 term);%0A%0A
+  @Nullable%0A
   Postin
@@ -656,32 +656,44 @@
 (String term);%0A%0A
+  @Nullable%0A
   Feature%3CIntege
@@ -716,24 +716,36 @@
 ing term);%0A%0A
+  @Nullable%0A
   Feature%3CPo
@@ -785,16 +785,28 @@
 term);%0A%0A
+  @Nullable%0A
   String
@@ -830,16 +830,162 @@
 int id);
+%0A%0A  /**%0A   * Returns -1 when not found.%0A   * @param documentName the document name to query.%0A   * @return the identifier or -1 if not found.%0A   */
 %0A  int g
@@ -1020,16 +1020,27 @@
 Name);%0A%0A
+  @Nonnull%0A
   Featur

Add nullability annotations to Index.java