Package Torello.JavaDoc.SyntaxHiLite
Interface HiLiteCache
-
- All Known Implementing Classes:
AbstractHashCodeHLC,HLC32,HLC64
public interface HiLiteCache
A Java Interface for caching-system classes that allows a Hi-Liter Tool to efficiently bypass calls to the server if-and-when an exact-copy of the hilited source-code already exists inside the cache.
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/SyntaxHiLite/HiLiteCache.java
- Open New Browser-Tab: Torello/JavaDoc/SyntaxHiLite/HiLiteCache.java
File Size: 3,043 Bytes Line Count: 68 '\n' Characters Found
-
-
Method Summary
Retrieving Files from the Cache & Inserting new Files into the Cache Modifier and Type Method Description voidcheckIn(String sourceCodeAsString, String hilitedCodeAsString, String codeTypeParam, boolean includeLineNumbers, byte styleNum)Store a newly highlighted source codeStringinto the cache for future retrieval.Stringget(String sourceCodeAsString, String codeTypeParam, boolean includeLineNumbers, byte styleNum)Retrieves a previously highlighted source codeStringfrom the cache if it exists.Check the Cache Size Modifier and Type Method Description inttotalNumber()Count how many files and directories are contained in thisCache.longtotalSize()Inform the user how much space (in bytes) is used by thisCache.Write Cache-State to Disk Modifier and Type Method Description voidpersistMasterHashToDisk()This will save the hash-codeTreeSet<Integer>to disk.
-
-
-
Method Detail
-
totalSize
long totalSize()
Inform the user how much space (in bytes) is used by thisCache.- 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 thisCache.- Returns:
- The total number of files and sub-directories in the
Cachedirectory.
-
persistMasterHashToDisk
void persistMasterHashToDisk() throws CacheError
This will save the hash-codeTreeSet<Integer>to disk. The Master Hash-Code List just keeps a record of the hashcodes of everyStringthat was hilited by the Hiliter (and therefore saved inside the Cache). This method will save that JavaTreeSetof Hash-Codes to disk.- Throws:
CacheError- ThisErrorwill throw if there is a problem writing the master cache-hash to disk. The chain-causeThrowableshould be visible, and is included as theThrowable.getCause()
-
get
java.lang.String get(java.lang.String sourceCodeAsString, java.lang.String codeTypeParam, boolean includeLineNumbers, byte styleNum)
Retrieves a previously highlighted source codeStringfrom 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, ornullif 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 codeStringinto 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.
-
-