Package Torello.JavaDoc.SyntaxHiLite
Class HLC32
- java.lang.Object
-
- Torello.JavaDoc.SyntaxHiLite.AbstractHashCodeHLC<java.lang.Integer>
-
- Torello.JavaDoc.SyntaxHiLite.HLC32
-
- All Implemented Interfaces:
HiLiteCache
public class HLC32 extends AbstractHashCodeHLC<java.lang.Integer>
A 32-Bit Java-Integerimplementation of a File-System Cache.
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/SyntaxHiLite/HLC32.java
- Open New Browser-Tab: Torello/JavaDoc/SyntaxHiLite/HLC32.java
File Size: 2,233 Bytes Line Count: 58 '\n' Characters Found
-
-
Field Summary
-
Fields inherited from class Torello.JavaDoc.SyntaxHiLite.AbstractHashCodeHLC
cacheSaveDirectory, NUMBER_CLASS
-
-
Constructor Summary
Constructors Constructor Description HLC32(String cacheSaveDirectory)Initializes a 64-Bit (Long) Cache in the specified directory.
-
Method Summary
Abstract Method for Calculating the Hash-Key used in Caching Files Modifier and Type Method Description IntegercomputeCacheKey(String codeTypeParam, boolean includeLineNumbers, byte styleNum, String sourceCodeAsString)Compute a Hash-Code for a given Source-File, and it's HiLiting Parameters-
Methods inherited from class Torello.JavaDoc.SyntaxHiLite.AbstractHashCodeHLC
checkIn, get, initializeDirectory, main, persistMasterHashToDisk, totalNumber, totalSize
-
-
-
-
Constructor Detail
-
HLC32
public HLC32(java.lang.String cacheSaveDirectory)
Initializes a 64-Bit (java.lang.Long) Cache in the specified directory. This will load the hashCodes table to memory from the file-system directory identified byString-Parameter'cacheSaveDirectory'. An exception shall be thrown if this file is not found, or the specified directory doesn't exist.- Parameters:
cacheSaveDirectory- This constructor presumes that this cache has been used and visited before. This directory name should point to your local-cache of theHiLite.MEServer Code hilite past-operations.- Throws:
CacheError- This error will throw if the cache has not been instantiated, or is corrupted. If the specified directory does not exist, then thisErrorshall also throw. The chain-causeThrowableshould be visible, and is included as theThrowable.getCause().
-
-
Method Detail
-
computeCacheKey
public java.lang.Integer computeCacheKey (java.lang.String codeTypeParam, boolean includeLineNumbers, byte styleNum, java.lang.String sourceCodeAsString)
Description copied from class:AbstractHashCodeHLCCompute a Hash-Code for a given Source-File, and it's HiLiting Parameters- Specified by:
computeCacheKeyin classAbstractHashCodeHLC<java.lang.Integer>- Parameters:
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.sourceCodeAsString- The unhighlighted source code text which is used for generating a "Hash Key" into the cache.- Returns:
- A key which may be used for saving a file to disk.
- Code:
- Exact Method Body:
return codeTypeParam.hashCode() + (includeLineNumbers ? 1 : 0) + styleNum + sourceCodeAsString.hashCode();
-
-