Index: src/java/org/apache/lucene/index/SegmentInfo.java =================================================================== --- src/java/org/apache/lucene/index/SegmentInfo.java (revision 793769) +++ src/java/org/apache/lucene/index/SegmentInfo.java (working copy) @@ -28,7 +28,11 @@ import java.util.ArrayList; import java.util.Collections; -final class SegmentInfo { +/** + * Information about a segment such as it's name, directory, and files related + * to the segment. + */ +public final class SegmentInfo { static final int NO = -1; // e.g. no norms; no deletes; static final int YES = 1; // e.g. have norms; have deletes; @@ -150,7 +154,7 @@ } // returns Map - Map getDiagnostics() { + public Map getDiagnostics() { return diagnostics; } @@ -251,7 +255,7 @@ /** Returns total size in bytes of all of files used by * this segment. */ - long sizeInBytes() throws IOException { + public long sizeInBytes() throws IOException { if (sizeInBytes == -1) { List files = files(); final int size = files.size(); @@ -267,7 +271,7 @@ return sizeInBytes; } - boolean hasDeletions() + public boolean hasDeletions() throws IOException { // Cases: // @@ -325,7 +329,7 @@ return si; } - String getDelFileName() { + public String getDelFileName() { if (delGen == NO) { // In this case we know there is no deletion filename // against this segment @@ -341,7 +345,7 @@ * * @param fieldNumber the field index to check */ - boolean hasSeparateNorms(int fieldNumber) + public boolean hasSeparateNorms(int fieldNumber) throws IOException { if ((normGen == null && preLockless) || (normGen != null && normGen[fieldNumber] == CHECK_DIR)) { // Must fallback to directory file exists check: @@ -357,7 +361,7 @@ /** * Returns true if any fields in this segment have separate norms. */ - boolean hasSeparateNorms() + public boolean hasSeparateNorms() throws IOException { if (normGen == null) { if (!preLockless) { @@ -424,7 +428,7 @@ * * @param number field index */ - String getNormFileName(int number) throws IOException { + public String getNormFileName(int number) throws IOException { String prefix; long gen; @@ -470,7 +474,7 @@ * Returns true if this segment is stored as a compound * file; else, false. */ - boolean getUseCompoundFile() throws IOException { + public boolean getUseCompoundFile() throws IOException { if (isCompoundFile == NO) { return false; } else if (isCompoundFile == YES) { @@ -480,7 +484,7 @@ } } - int getDelCount() throws IOException { + public int getDelCount() throws IOException { if (delCount == -1) { if (hasDeletions()) { final String delFileName = getDelFileName(); @@ -510,7 +514,7 @@ clearFiles(); } - String getDocStoreSegment() { + public String getDocStoreSegment() { return docStoreSegment; } Index: src/java/org/apache/lucene/index/SegmentInfos.java =================================================================== --- src/java/org/apache/lucene/index/SegmentInfos.java (revision 793769) +++ src/java/org/apache/lucene/index/SegmentInfos.java (working copy) @@ -34,7 +34,11 @@ import java.util.HashMap; import java.util.Map; -final class SegmentInfos extends Vector { +/** + * A collection of segmentInfo objects with methods for operating on + * those segments in relation to the file system. + */ +public final class SegmentInfos extends Vector { /** The file format version, a negative number. */ /* Works since counter, the old 1st entry, is always >= 0 */ @@ -767,7 +771,7 @@ version = other.version; } - public final void rollbackCommit(Directory dir) throws IOException { + final void rollbackCommit(Directory dir) throws IOException { if (pendingSegnOutput != null) { try { pendingSegnOutput.close(); @@ -796,7 +800,7 @@ * end, so that it is not visible to readers. Once this * is called you must call {@link #finishCommit} to complete * the commit or {@link #rollbackCommit} to abort it. */ - public final void prepareCommit(Directory dir) throws IOException { + final void prepareCommit(Directory dir) throws IOException { if (pendingSegnOutput != null) throw new IllegalStateException("prepareCommit was already called"); write(dir); @@ -822,7 +826,7 @@ return files; } - public final void finishCommit(Directory dir) throws IOException { + final void finishCommit(Directory dir) throws IOException { if (pendingSegnOutput == null) throw new IllegalStateException("prepareCommit was not called"); boolean success = false; @@ -882,7 +886,7 @@ /** Writes & syncs to the Directory dir, taking care to * remove the segments file on exception */ - public final void commit(Directory dir) throws IOException { + final void commit(Directory dir) throws IOException { prepareCommit(dir); finishCommit(dir); } @@ -906,7 +910,7 @@ return userData; } - public void setUserData(Map data) { + void setUserData(Map data) { if (data == null) { userData = Collections.EMPTY_MAP; } else {