org.apache.lucene.index
Class SegmentInfo

java.lang.Object
  extended by org.apache.lucene.index.SegmentInfo

public final class SegmentInfo
extends Object

Information about a segment such as it's name, directory, and files related to the segment. *

NOTE: This API is new and still experimental (subject to change suddenly in the next release)


Field Summary
 Directory dir
           
 int docCount
           
 String name
           
 
Constructor Summary
SegmentInfo(String name, int docCount, Directory dir)
           
SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, boolean hasSingleNormFile)
           
SegmentInfo(String name, int docCount, Directory dir, boolean isCompoundFile, boolean hasSingleNormFile, int docStoreOffset, String docStoreSegment, boolean docStoreIsCompoundFile, boolean hasProx)
           
 
Method Summary
 Object clone()
           
 boolean equals(Object obj)
          We consider another SegmentInfo instance equal if it has the same dir and same name.
 List<String> files()
           
 int getDelCount()
           
 String getDelFileName()
           
 Map<String,String> getDiagnostics()
           
 boolean getDocStoreIsCompoundFile()
           
 int getDocStoreOffset()
           
 String getDocStoreSegment()
           
 boolean getHasProx()
           
 String getNormFileName(int number)
          Get the file name for the norms file for this field.
 boolean getUseCompoundFile()
          Returns true if this segment is stored as a compound file; else, false.
 boolean hasDeletions()
           
 int hashCode()
           
 boolean hasSeparateNorms()
          Returns true if any fields in this segment have separate norms.
 boolean hasSeparateNorms(int fieldNumber)
          Returns true if this field for this segment has saved a separate norms file (__N.sX).
 String segString(Directory dir)
          Used for debugging
 long sizeInBytes()
          Returns total size in bytes of all of files used by this segment.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public String name

docCount

public int docCount

dir

public Directory dir
Constructor Detail

SegmentInfo

public SegmentInfo(String name,
                   int docCount,
                   Directory dir)

SegmentInfo

public SegmentInfo(String name,
                   int docCount,
                   Directory dir,
                   boolean isCompoundFile,
                   boolean hasSingleNormFile)

SegmentInfo

public SegmentInfo(String name,
                   int docCount,
                   Directory dir,
                   boolean isCompoundFile,
                   boolean hasSingleNormFile,
                   int docStoreOffset,
                   String docStoreSegment,
                   boolean docStoreIsCompoundFile,
                   boolean hasProx)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getDiagnostics

public Map<String,String> getDiagnostics()

sizeInBytes

public long sizeInBytes()
                 throws IOException
Returns total size in bytes of all of files used by this segment.

Throws:
IOException

hasDeletions

public boolean hasDeletions()
                     throws IOException
Throws:
IOException

clone

public Object clone()
Overrides:
clone in class Object

getDelFileName

public String getDelFileName()

hasSeparateNorms

public boolean hasSeparateNorms(int fieldNumber)
                         throws IOException
Returns true if this field for this segment has saved a separate norms file (__N.sX).

Parameters:
fieldNumber - the field index to check
Throws:
IOException

hasSeparateNorms

public boolean hasSeparateNorms()
                         throws IOException
Returns true if any fields in this segment have separate norms.

Throws:
IOException

getNormFileName

public String getNormFileName(int number)
                       throws IOException
Get the file name for the norms file for this field.

Parameters:
number - field index
Throws:
IOException

getUseCompoundFile

public boolean getUseCompoundFile()
                           throws IOException
Returns true if this segment is stored as a compound file; else, false.

Throws:
IOException

getDelCount

public int getDelCount()
                throws IOException
Throws:
IOException

getDocStoreOffset

public int getDocStoreOffset()

getDocStoreIsCompoundFile

public boolean getDocStoreIsCompoundFile()

getDocStoreSegment

public String getDocStoreSegment()

getHasProx

public boolean getHasProx()

files

public List<String> files()
                   throws IOException
Throws:
IOException

segString

public String segString(Directory dir)
Used for debugging


equals

public boolean equals(Object obj)
We consider another SegmentInfo instance equal if it has the same dir and same name.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.