org.eclipse.rdf4j.sail.nativerdf.datastore

## Class HashFile

- java.lang.Object
- - org.eclipse.rdf4j.sail.nativerdf.datastore.HashFile

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class HashFile
      extends Object
      implements Closeable

  Class supplying access to a hash file.
  Author:
    Arjohn Kampman

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `HashFile.IDIterator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HashFile(File file)`
    `HashFile(File file, boolean forceSync)`
    `HashFile(File file, boolean forceSync, int initialSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `void` | `close()`
    `File` | `getFile()`
    `HashFile.IDIterator` | `getIDIterator(int hash)` Gets an iterator that iterates over the IDs with hash codes that match the specified hash code.
    `int` | `getItemCount()`
    `void` | `storeID(int hash, int id)` Stores ID under the specified hash code in this hash file.
    `void` | `sync()` Syncs any unstored data to the hash file.
    `void` | `sync(boolean force)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HashFile

          public HashFile(File file)
                   throws IOException

      Throws:
        `IOException`

    - #### HashFile

          public HashFile(File file,
                          boolean forceSync)
                   throws IOException

      Throws:
        `IOException`

    - #### HashFile

          public HashFile(File file,
                          boolean forceSync,
                          int initialSize)
                   throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### getFile

          public File getFile()

    - #### getItemCount

          public int getItemCount()

    - #### getIDIterator

          public HashFile.IDIterator getIDIterator(int hash)
                                            throws IOException

      Gets an iterator that iterates over the IDs with hash codes that match the specified hash code.
      Throws:
        `IOException`

    - #### storeID

          public void storeID(int hash,
                              int id)
                       throws IOException

      Stores ID under the specified hash code in this hash file.
      Throws:
        `IOException`

    - #### clear

          public void clear()
                     throws IOException

      Throws:
        `IOException`

    - #### sync

          public void sync()
                    throws IOException

      Syncs any unstored data to the hash file.
      Throws:
        `IOException`

    - #### sync

          public void sync(boolean force)
                    throws IOException

      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.