org.xcmis.search.lucene.index
Class IndexInfo

java.lang.Object
  extended by org.xcmis.search.lucene.index.IndexInfo

public class IndexInfo
extends Object

Created by The eXo Platform SAS.

Version:
$Id: IndexInfo.java 2 2010-02-04 17:21:49Z andrew00x $
Author:
Sergey Kabashnyuk

Constructor Summary
IndexInfo(String fileName)
          Creates a new IndexInfos using fileName.
 
Method Summary
 void addName(String indexName)
          Adds a name to the index infos.
 boolean contains(String indexName)
          Returns true if name exists in this IndexInfos; false otherwise.
 boolean exists(File dir)
          Returns true if this index infos exists in dir.
 String getFileName()
          Returns the name of the file where infos are stored.
 String getName(int i)
          Returns the index name at position i.
 String newName()
          Returns a new unique name for an index folder.
 void read(File dir)
          Reads the index infos.
 void removeName(int i)
          Removes the name from the index infos.
 void removeName(String indexName)
          Removes the name from the index infos.
 int size()
          Returns the number of index names.
 void write(File dir)
          Writes the index infos to disk if they are dirty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexInfo

public IndexInfo(String fileName)
Creates a new IndexInfos using fileName.

Parameters:
fileName - the name of the file where infos are stored.
Method Detail

exists

public boolean exists(File dir)
Returns true if this index infos exists in dir.

Parameters:
dir - the directory where to look for the index infos.
Returns:
true if it exists; false otherwise.

getFileName

public String getFileName()
Returns the name of the file where infos are stored.

Returns:
the name of the file where infos are stored.

read

public void read(File dir)
          throws IndexException
Reads the index infos.

Parameters:
dir - the directory from where to read the index infos.
Throws:
IOException - if an error occurs.
IndexException

write

public void write(File dir)
           throws IOException
Writes the index infos to disk if they are dirty.

Parameters:
dir - the directory where to write the index infos.
Throws:
IOException - if an error occurs.

getName

public String getName(int i)
Returns the index name at position i.

Parameters:
i - the position.
Returns:
the index name.

size

public int size()
Returns the number of index names.

Returns:
the number of index names.

addName

public void addName(String indexName)
Adds a name to the index infos.

Parameters:
name - the name to add.

removeName

public void removeName(String indexName)
Removes the name from the index infos.

Parameters:
name - the name to remove.

removeName

public void removeName(int i)
Removes the name from the index infos.

Parameters:
i - the position.

contains

public boolean contains(String indexName)
Returns true if name exists in this IndexInfos; false otherwise.

Parameters:
name - the name to test existence.
Returns:
true it is exists in this IndexInfos.

newName

public String newName()
Returns a new unique name for an index folder.

Returns:
a new unique name for an index folder.


Copyright © 2011 eXo Platform SAS. All Rights Reserved.