Package Torello.JavaDoc.SyntaxHiLite
Class HLC64
- java.lang.Object
-
- Torello.JavaDoc.SyntaxHiLite.AbstractHashCodeHLC<java.lang.Long>
-
- Torello.JavaDoc.SyntaxHiLite.HLC64
-
- All Implemented Interfaces:
HiLiteCache
public class HLC64 extends AbstractHashCodeHLC<java.lang.Long>
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/SyntaxHiLite/HLC64.java
- Open New Browser-Tab: Torello/JavaDoc/SyntaxHiLite/HLC64.java
File Size: 1,772 Bytes Line Count: 64 '\n' Characters Found
-
-
Field Summary
-
Fields inherited from class Torello.JavaDoc.SyntaxHiLite.AbstractHashCodeHLC
cacheSaveDirectory, NUMBER_CLASS
-
-
Constructor Summary
Constructors Constructor HLC64(String cacheSaveDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Long
computeCacheKey(String codeTypeParam, boolean includeLineNumbers, byte styleNum, String sourceCodeAsString)
-
Methods inherited from class Torello.JavaDoc.SyntaxHiLite.AbstractHashCodeHLC
checkIn, get, initializeOrClear, main, persistMasterHashToDisk, totalNumber, totalSize
-
-
-
-
Constructor Detail
-
HLC64
public HLC64(java.lang.String cacheSaveDirectory)
-
-
Method Detail
-
computeCacheKey
public java.lang.Long computeCacheKey(java.lang.String codeTypeParam, boolean includeLineNumbers, byte styleNum, java.lang.String sourceCodeAsString)
Description copied from class:AbstractHashCodeHLC
Compute a Hash-Code- Specified by:
computeCacheKey
in classAbstractHashCodeHLC<java.lang.Long>
- 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:
final long FNV_PRIME = 0x100000001b3L; long hash = 0xcbf29ce484222325L; // Mix in codeTypeParam for (int i = 0; i < codeTypeParam.length(); i++) { hash ^= codeTypeParam.charAt(i); hash *= FNV_PRIME; } // Mix in includeLineNumbers hash ^= (includeLineNumbers ? 1 : 0); hash *= FNV_PRIME; // Mix in styleNum hash ^= styleNum; hash *= FNV_PRIME; // Mix in sourceCodeAsString for (int i = 0; i < sourceCodeAsString.length(); i++) { hash ^= sourceCodeAsString.charAt(i); hash *= FNV_PRIME; } return hash;
-
-