Class FileBasedIndex

  • All Implemented Interfaces:
    StringIndex

    public class FileBasedIndex
    extends HashMapIndex
    Implements a StringIndex that is based on a hashmap and persists the names as property file.
    • Constructor Detail

      • FileBasedIndex

        public FileBasedIndex​(FileSystemResource file)
                       throws FileSystemException,
                              IOException
        Creates a new hashmap index and loads the lookup tables from the filesystem resource. If it does not exist yet, it will create a new one.
        Parameters:
        file - the filesystem resource that stores the lookup tables.
        Throws:
        IOException - if an I/O error occurs.
        FileSystemException - if an I/O error occurs.
    • Method Detail

      • load

        protected void load()
        Loads the lookup table from the filesystem resource.
        Overrides:
        load in class HashMapIndex
      • save

        protected void save()
        Saves the lookup table to the filesystem resource.
        Overrides:
        save in class HashMapIndex