Java Doc for FPGenerator.java in  » Web-Crawler » heritrix » st » ata » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Crawler » heritrix » st.ata.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   st.ata.util.FPGenerator

FPGenerator
final public class FPGenerator (Code)

This class provides methods that construct fingerprints of strings of bytes via operations in GF[2^d] for 0 < d <= 64. GF[2^d] is represented as the set of polynomials of degree d with coefficients in Z(2), modulo an irreducible polynomial P of degree d. The representation of polynomials is as an unsigned binary number in which the least significant exponent is kept in the most significant bit.

Let S be a string of bytes and g(S) the string obtained by taking the byte 0x01 followed by eight 0x00 bytes followed by S. Let f(S) be the polynomial associated to the string S viewed as a polynomial with coefficients in the field Z(2). The fingerprint of S is simply the value f(g(S)) modulo P. Because polynomials are represented with the least significant coefficient in the most significant bit, fingerprints of degree d are stored in the d most significant bits of a long word.

Fingerprints can be used as a probably unique id for the input string. More precisely, if P is chosen at random among irreducible polynomials of degree d, then the probability that any two strings A and B have the same fingerprint is less than max(|A|,|B|)/2^(d+1) where |A| is the length of A in bits.

The routines named extend[8] and fp[8] return reduced results, while extend_[byte/char/int/long] do not. An unreduced result is a number that is equal (mod polynomial to the desired fingerprint but may have degree degree or higher. The method reduce reduces such a result to a polynomial of degree less than degree. Obtaining reduced results takes longer than obtaining unreduced results; thus, when fingerprinting long strings, it's better to obtain irreduced results inside the fingerprinting loop and use reduce to reduce to a fingerprint after the loop.



Field Summary
final public  intdegree
     The number of bits in fingerprints generated by this.
final public  longempty
     Fingerprint of the empty string of bytes.
public  longpolynomial
     The polynomial used by this to generate fingerprints.
final public static  longpolynomials
     Array of irreducible polynomials.
final public static  FPGeneratorstd24
     A standard 24-bit fingerprint generator using polynomials[0][24].
final public static  FPGeneratorstd32
     A standard 32-bit fingerprint generator using polynomials[0][32].
final public static  FPGeneratorstd40
     A standard 40-bit fingerprint generator using polynomials[0][40].
final public static  FPGeneratorstd64
     The standard 64-bit fingerprint generator using polynomials[0][64].


Method Summary
public  longextend(long f, byte v)
     Extends fingerprint f by adding the low eight bits of "b".
public  longextend(long f, char v)
     Extends fingerprint f by adding (all bits of) "v".
public  longextend(long f, int v)
     Extends fingerprint f by adding (all bits of) "v".
public  longextend(long f, long v)
     Extends fingerprint f by adding (all bits of) "v".
public  longextend(long f, byte[] buf, int start, int n)
     Extends fingerprint f by adding "n" bytes of "buf" starting from "buf[start]". Result is reduced. Requires "[i, i+n)" is in bounds.
public  longextend(long f, char[] buf, int start, int n)
     Extends fingerprint f by adding (all bits of) "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.
public  longextend(long f, CharSequence s)
     Extends fingerprint f by adding (all bits of) the characters of "s". Result is reduced.
public  longextend(long f, int[] buf, int start, int n)
     Extends fingerprint f by adding (all bits of) "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.
public  longextend(long f, long[] buf, int start, int n)
     Extends fingerprint f by adding (all bits of) "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.
public  longextend8(long f, String s)
     Extends fingerprint f by adding the lower eight bits of the characters of "s". Result is reduced.
public  longextend8(long f, char[] buf, int start, int n)
     Extends fingerprint f by adding the lower eight bits of "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.
public  longextend_byte(long f, int v)
     Extends f with lower eight bits of v without full reduction.
public  longextend_char(long f, int v)
     Extends f with lower sixteen bits of v. Does not reduce.
public  longextend_int(long f, int v)
     Extends f with (all bits of) v. Does not reduce.
public  longextend_long(long f, long v)
     Extends f with v. Does not reduce.
public  longfp(byte[] buf, int start, int n)
     Compute fingerprint of "n" bytes of "buf" starting from "buf[start]".
public  longfp(char[] buf, int start, int n)
     Compute fingerprint of (all bits of) "n" characters of "buf" starting from "buf[i]".
public  longfp(CharSequence s)
     Compute fingerprint of (all bits of) the characters of "s".
public  longfp(int[] buf, int start, int n)
     Compute fingerprint of (all bits of) "n" characters of "buf" starting from "buf[i]".
public  longfp(long[] buf, int start, int n)
     Compute fingerprint of (all bits of) "n" characters of "buf" starting from "buf[i]".
public  longfp8(String s)
     Compute fingerprint of the lower eight bits of the characters of "s".
public  longfp8(char[] buf, int start, int n)
     Compute fingerprint of the lower eight bits of "n" characters of "buf" starting from "buf[i]".
public static  FPGeneratormake(long polynomial, int degree)
     Return a fingerprint generator.
public  longreduce(long fp)
     Return a value equal (mod polynomial) to fp and of degree less than degree.

Field Detail
degree
final public int degree(Code)
The number of bits in fingerprints generated by this.



empty
final public long empty(Code)
Fingerprint of the empty string of bytes.



polynomial
public long polynomial(Code)
The polynomial used by this to generate fingerprints.



polynomials
final public static long polynomials(Code)
Array of irreducible polynomials. For each degree d between 1 and 64 (inclusive), polynomials[d][i] is an irreducible polynomial of degree d. There are at least two irreducible polynomials for each degree.



std24
final public static FPGenerator std24(Code)
A standard 24-bit fingerprint generator using polynomials[0][24].



std32
final public static FPGenerator std32(Code)
A standard 32-bit fingerprint generator using polynomials[0][32].



std40
final public static FPGenerator std40(Code)
A standard 40-bit fingerprint generator using polynomials[0][40].



std64
final public static FPGenerator std64(Code)
The standard 64-bit fingerprint generator using polynomials[0][64].





Method Detail
extend
public long extend(long f, byte v)(Code)
Extends fingerprint f by adding the low eight bits of "b".



extend
public long extend(long f, char v)(Code)
Extends fingerprint f by adding (all bits of) "v".



extend
public long extend(long f, int v)(Code)
Extends fingerprint f by adding (all bits of) "v".



extend
public long extend(long f, long v)(Code)
Extends fingerprint f by adding (all bits of) "v".



extend
public long extend(long f, byte[] buf, int start, int n)(Code)
Extends fingerprint f by adding "n" bytes of "buf" starting from "buf[start]". Result is reduced. Requires "[i, i+n)" is in bounds.



extend
public long extend(long f, char[] buf, int start, int n)(Code)
Extends fingerprint f by adding (all bits of) "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.



extend
public long extend(long f, CharSequence s)(Code)
Extends fingerprint f by adding (all bits of) the characters of "s". Result is reduced.



extend
public long extend(long f, int[] buf, int start, int n)(Code)
Extends fingerprint f by adding (all bits of) "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.



extend
public long extend(long f, long[] buf, int start, int n)(Code)
Extends fingerprint f by adding (all bits of) "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.



extend8
public long extend8(long f, String s)(Code)
Extends fingerprint f by adding the lower eight bits of the characters of "s". Result is reduced.



extend8
public long extend8(long f, char[] buf, int start, int n)(Code)
Extends fingerprint f by adding the lower eight bits of "n" characters of "buf" starting from "buf[i]". Result is reduced. Requires "[i, i+n)" is in bounds.



extend_byte
public long extend_byte(long f, int v)(Code)
Extends f with lower eight bits of v without full reduction. In other words, returns a polynomial that is equal (mod polynomial) to the desired fingerprint but may be of higher degree than the desired fingerprint.



extend_char
public long extend_char(long f, int v)(Code)
Extends f with lower sixteen bits of v. Does not reduce.



extend_int
public long extend_int(long f, int v)(Code)
Extends f with (all bits of) v. Does not reduce.



extend_long
public long extend_long(long f, long v)(Code)
Extends f with v. Does not reduce.



fp
public long fp(byte[] buf, int start, int n)(Code)
Compute fingerprint of "n" bytes of "buf" starting from "buf[start]". Requires "[start, start+n)" is in bounds.



fp
public long fp(char[] buf, int start, int n)(Code)
Compute fingerprint of (all bits of) "n" characters of "buf" starting from "buf[i]". Requires "[i, i+n)" is in bounds.



fp
public long fp(CharSequence s)(Code)
Compute fingerprint of (all bits of) the characters of "s".



fp
public long fp(int[] buf, int start, int n)(Code)
Compute fingerprint of (all bits of) "n" characters of "buf" starting from "buf[i]". Requires "[i, i+n)" is in bounds.



fp
public long fp(long[] buf, int start, int n)(Code)
Compute fingerprint of (all bits of) "n" characters of "buf" starting from "buf[i]". Requires "[i, i+n)" is in bounds.



fp8
public long fp8(String s)(Code)
Compute fingerprint of the lower eight bits of the characters of "s".



fp8
public long fp8(char[] buf, int start, int n)(Code)
Compute fingerprint of the lower eight bits of "n" characters of "buf" starting from "buf[i]". Requires "[i, i+n)" is in bounds.



make
public static FPGenerator make(long polynomial, int degree)(Code)
Return a fingerprint generator. The fingerprints generated will have degree degree and will be generated by polynomial. If a generator based on polynomial has already been created, it will be returned. Requires that polynomial is an irreducible polynomial of degree degree (the array polynomials contains some irreducible polynomials).



reduce
public long reduce(long fp)(Code)
Return a value equal (mod polynomial) to fp and of degree less than degree.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.