Java Doc for HashIndex.java in  » Database-DBMS » hsql » org » hsqldb » store » 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 » Database DBMS » hsql » org.hsqldb.store 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.store.HashIndex

HashIndex
class HashIndex (Code)
A chained bucket hash index implementation. hashTable and linkTable are arrays of signed integral types. This implementation uses int as the type but short or byte can be used for smaller index sizes (cardinality). hashTable[index] contains the pointer to the first node with (index == hash modulo hashTable.length) or -1 if there is no corresponding node. linkTable[{0,newNodePointer}] (the range between 0 and newNodePointer) contains either the pointer to the next node or -1 if there is no such node. reclaimedNodeIndex contains a pointer to an element of linkTable which is the first element in the list of reclaimed nodes (nodes no longer in index) or -1 if there is no such node. elemenet at and above linkTable[newNodePointer] have never been used as a node and their contents is not significant.
author:
   fredt@users
version:
   1.7.2
since:
   1.7.2


Field Summary
 intelementCount
    
 booleanfixedSize
    
 int[]hashTable
    
 int[]linkTable
    
 intnewNodePointer
    
 intreclaimedNodePointer
    

Constructor Summary
 HashIndex(int hashTableSize, int capacity, boolean fixedSize)
    

Method Summary
 voidclear()
     Reset the index as empty.
 intgetHashIndex(int hash)
    
 intgetLookup(int hash)
     Return the array index for a hash.
 intgetNextLookup(int lookup)
     This looks from a given node, so the parameter is always > -1.
 intlinkNode(int index, int lastLookup)
     Link a new node to the end of the linked for a hash index.
 booleanremoveEmptyNode(int lookup)
     Remove a node that has already been unlinked.
 voidreset(int hashTableSize, int capacity)
     Reset the structure with a new size as empty.
 voidresetTables()
    
 voidunlinkNode(int index, int lastLookup, int lookup)
     Unlink a node from a linked list and link into the reclaimed list.

Field Detail
elementCount
int elementCount(Code)



fixedSize
boolean fixedSize(Code)



hashTable
int[] hashTable(Code)



linkTable
int[] linkTable(Code)



newNodePointer
int newNodePointer(Code)



reclaimedNodePointer
int reclaimedNodePointer(Code)




Constructor Detail
HashIndex
HashIndex(int hashTableSize, int capacity, boolean fixedSize)(Code)




Method Detail
clear
void clear()(Code)
Reset the index as empty.



getHashIndex
int getHashIndex(int hash)(Code)

Parameters:
  hash -



getLookup
int getLookup(int hash)(Code)
Return the array index for a hash.
Parameters:
  hash - the hash value used for indexing either -1 or the first node for this hash value



getNextLookup
int getNextLookup(int lookup)(Code)
This looks from a given node, so the parameter is always > -1.
Parameters:
  valid - lookup node to look from either -1 or the next node from this node



linkNode
int linkNode(int index, int lastLookup)(Code)
Link a new node to the end of the linked for a hash index.
Parameters:
  index - an index into hashTable
Parameters:
  lastLookup - either -1 or the node to which the new node will be linked the new node



removeEmptyNode
boolean removeEmptyNode(int lookup)(Code)
Remove a node that has already been unlinked. This is not required for index operations. It is used only when the row needs to be removed from the data structures that store the actual indexed data and the nodes need to be contiguous.
Parameters:
  lookup - the node to remove true if node found in unlinked state



reset
void reset(int hashTableSize, int capacity)(Code)
Reset the structure with a new size as empty.
Parameters:
  hashTableSize -
Parameters:
  capacity -



resetTables
void resetTables()(Code)



unlinkNode
void unlinkNode(int index, int lastLookup, int lookup)(Code)
Unlink a node from a linked list and link into the reclaimed list.
Parameters:
  index - an index into hashTable
Parameters:
  lastLookup - either -1 or the node to which the target node is linked
Parameters:
  lookup - the node to remove



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.