Interface HiLiteCache

    • Method Summary

       
      Retrieving Files from the Cache & Inserting new Files into the Cache
      Modifier and Type Method Description
      void checkIn​(String sourceCodeAsString, String hilitedCodeAsString, String codeTypeParam, boolean includeLineNumbers, byte styleNum)
      Store a newly highlighted source code String into the cache for future retrieval.
      String get​(String sourceCodeAsString, String codeTypeParam, boolean includeLineNumbers, byte styleNum)
      Retrieves a previously highlighted source code String from the cache if it exists.
       
      Check the Cache Size
      Modifier and Type Method Description
      int totalNumber()
      Count how many files and directories are contained in this Cache.
      long totalSize()
      Inform the user how much space (in bytes) is used by this Cache.
       
      Write Cache-State to Disk
      Modifier and Type Method Description
      void persistMasterHashToDisk()
      This will save the hash-code TreeSet<Integer> to disk.
    • Method Detail

      • totalSize

        🡇     🗕  🗗  🗖
        long totalSize()
        Inform the user how much space (in bytes) is used by this Cache.
        Returns:
        The number of bytes being used on the file-system by this Cache.
      • totalNumber

        🡅  🡇     🗕  🗗  🗖
        int totalNumber()
        Count how many files and directories are contained in this Cache.
        Returns:
        The total number of files and sub-directories in the Cache directory.
      • persistMasterHashToDisk

        🡅  🡇     🗕  🗗  🗖
        void persistMasterHashToDisk()
                              throws CacheError
        This will save the hash-code TreeSet<Integer> to disk. The Master Hash-Code List just keeps a record of the hashcodes of every String that was hilited by the Hiliter (and therefore saved inside the Cache). This method will save that Java TreeSet of Hash-Codes to disk.
        Throws:
        CacheError - This Error will throw if there is a problem writing the master cache-hash to disk. The chain-cause Throwable should be visible, and is included as the Throwable.getCause()
      • get

        🡅  🡇     🗕  🗗  🗖
        java.lang.String get​(java.lang.String sourceCodeAsString,
                             java.lang.String codeTypeParam,
                             boolean includeLineNumbers,
                             byte styleNum)
        Retrieves a previously highlighted source code String from the cache if it exists. If a Cache-Miss has occurred, then this method shall return null.
        Parameters:
        sourceCodeAsString - The unhighlighted source code text which is used for generating a "Hash Key" into the cache.
        codeTypeParam - The code type identifier (e.g., 'java', 'html', 'css') used to distinguish syntax rules.
        includeLineNumbers - A flag indicating whether line numbers are to be included in the highlighted HTML output.
        styleNum - A numeric style identifier used to determine which syntax color scheme should be applied.
        Returns:
        The highlighted version of the source code as a String, or null if not cached.
      • checkIn

        🡅     🗕  🗗  🗖
        void checkIn​(java.lang.String sourceCodeAsString,
                     java.lang.String hilitedCodeAsString,
                     java.lang.String codeTypeParam,
                     boolean includeLineNumbers,
                     byte styleNum)
        Store a newly highlighted source code String into the cache for future retrieval.
        Parameters:
        sourceCodeAsString - The unhighlighted source code text which is used for generating a "Hash Key" into the cache.
        codeTypeParam - The code type identifier (e.g., 'java', 'html', 'css') used to distinguish syntax rules.
        includeLineNumbers - A flag indicating whether line numbers are to be included in the highlighted HTML output.
        styleNum - A numeric style identifier used to determine which syntax color scheme should be applied.