|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.store.Directory
org.apache.lucene.store.RAMDirectory
public final class RAMDirectory
A memory-resident Directory
implementation.
Constructor Summary | |
---|---|
RAMDirectory()
Constructs an empty Directory . |
|
RAMDirectory(Directory dir)
Creates a new RAMDirectory instance from a different
Directory implementation. |
|
RAMDirectory(File dir)
Creates a new RAMDirectory instance from the FSDirectory . |
|
RAMDirectory(String dir)
Creates a new RAMDirectory instance from the FSDirectory . |
Method Summary | |
---|---|
void |
close()
Closes the store to future operations. |
IndexOutput |
createOutput(String name)
Creates a new, empty file in the directory with the given name. |
void |
deleteFile(String name)
Removes an existing file in the directory. |
boolean |
fileExists(String name)
Returns true iff the named file exists in this directory. |
long |
fileLength(String name)
Returns the length in bytes of a file in the directory. |
long |
fileModified(String name)
Returns the time the named file was last modified. |
String[] |
list()
Returns an array of strings, one for each file in the directory. |
Lock |
makeLock(String name)
Construct a Lock . |
IndexInput |
openInput(String name)
Returns a stream reading an existing file. |
void |
renameFile(String from,
String to)
Removes an existing file in the directory. |
void |
touchFile(String name)
Set the modified time of an existing file to now. |
Methods inherited from class org.apache.lucene.store.Directory |
---|
createFile, openFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RAMDirectory()
Directory
.
public RAMDirectory(Directory dir) throws IOException
RAMDirectory
instance from a different
Directory
implementation. This can be used to load
a disk-based index into memory.
This should be used only with indices that can fit into memory.
dir
- a Directory
value
IOException
- if an error occurspublic RAMDirectory(File dir) throws IOException
RAMDirectory
instance from the FSDirectory
.
dir
- a File
specifying the index directory
IOException
public RAMDirectory(String dir) throws IOException
RAMDirectory
instance from the FSDirectory
.
dir
- a String
specifying the full index directory path
IOException
Method Detail |
---|
public final String[] list()
list
in class Directory
public final boolean fileExists(String name)
fileExists
in class Directory
public final long fileModified(String name)
fileModified
in class Directory
public void touchFile(String name)
touchFile
in class Directory
public final long fileLength(String name)
fileLength
in class Directory
public final void deleteFile(String name)
deleteFile
in class Directory
public final void renameFile(String from, String to)
renameFile
in class Directory
public final IndexOutput createOutput(String name)
createOutput
in class Directory
public final IndexInput openInput(String name)
openInput
in class Directory
public final Lock makeLock(String name)
Lock
.
makeLock
in class Directory
name
- the name of the lock filepublic final void close()
close
in class Directory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |