Class FileManagerImpl

java.lang.Object
net.didion.jwnl.dictionary.file_manager.FileManagerImpl
All Implemented Interfaces:
Remote, FileManager, Createable
Direct Known Subclasses:
RemoteFileManager

public class FileManagerImpl extends Object implements FileManager
An implementation of FileManager that reads files from the local file system. FileManagerImpl caches the file position before and after readLineAt in order to eliminate the redundant IO activity that a naive implementation of these methods would necessitate.
  • Field Details

    • FILE_TYPE

      public static final String FILE_TYPE
      File type install parameter. The value should be the name of the appropriate subclass of DictionaryFileType.
      See Also:
    • PATH

      public static final String PATH
      Dictionary path install parameter. The value should be the absolute path of the directory containing the dictionary files.
      See Also:
    • _rand

      private static final Random _rand
      Random number generator used by getRandomLineOffset().
    • _files

      private DictionaryCatalogSet _files
      The catalog set.
  • Constructor Details

    • FileManagerImpl

      public FileManagerImpl()
      Uninitialized FileManagerImpl.
    • FileManagerImpl

      public FileManagerImpl(String searchDir, Class dictionaryFileType) throws IOException
      Construct a file manager backed by a set of files contained in the default WN search directory.
      Throws:
      IOException
  • Method Details