Java Doc for BTOperations.java in  » Search-Engine » Jofti » com » jofti » btree » 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 » Search Engine » Jofti » com.jofti.btree 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jofti.btree.BTOperations

BTOperations
public class BTOperations (Code)
Provides the group of low level operations that can be performed on the BTree. All operations on the BTree are performed by this class ,rather than directly on the tree.

The class is essentially an encapsulation of the functional update,search, contains and remove variants used by the TreeIndex. The class does not retain a handle to any particular BTree and so the same instance can be used for the transactional BTree instances found in some Tree instances.


author:
   Steve Woodcock

version:
   1.31




Method Summary
public static  booleancontains(BTree tree, Comparable obj, int dimension)
     Checks if the tree contains a particular value in a dimension.
public static  MapgetAllResultsForDimension(BTree tree, int dimension)
     Gets a collection of all uniqueIds in tree for a specific dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  dimension - - the dimension where the key is by type.

public static  CollectiongetAllValuesForKey(BTree tree, Comparable obj, int startDimension)
     Gets a collection of all value/dimension matches in the tree for a specific uniqueid. This method is used when we have a uniqueId and no object left in the cache (due to expiry etc) and so the only alternative is a scan of the leaf nodes to find matches.
public static  INodegetHighestNodeForDimension(BTree tree, int dimension)
     Gets the node containing the last entry for a dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  dimension - - the dimension where the key is by type.

public static  CollectiongetKeyAttributes(BTree tree, Comparable obj, int dimension)
     Returns the keys that are mapped against the comparable value.
public static  INodegetLowestNodeForDimension(BTree tree, int dimension)
     Gets the node containing the first entry for a dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  dimension - - the dimension where the key is by type.

public static  MapgetSubTreeKeyValues(BTree tree, Comparable startObj, Comparable endObj, int dimension, int endDimension, boolean inclusive)
     Gets all the uniqueIds that are contained in the tree between two values irrespective of the dimension.
public static  voidinsertKeyValue(BTree tree, Comparable key, Map attributes, int dimension)
     Inserts a key and the object attributes in the tree using a specific key dimension.
public static  voidinsertValue(BTree tree, Comparable key, Comparable object, int dimension)
     Inserts a value in the tree using a specific dimension.
public static  Mapmatch(BTree tree, Comparable obj, int dimension)
     Retrieves the matching uniqueIds for a particular value and dimension (if any).
public static  Mapmatch(BTree tree, Comparable obj, int dimension, Object valueReturn)
     Retrieves the matching uniqueIds for a particular value and dimension (if any).
public static  Mapmatch(BTree tree, Comparable[] obj, int dimension)
     Retrieves the matching uniqueIds for a particular array of values and dimension (if any).
public static  Mapmatch(BTree tree, Comparable[] obj, int dimension, Object alias)
     Retrieves the matching uniqueIds for a particular array of values and dimension (if any). The alias is used to pecify which alis we should use for the id.
public static  MapnotEqual(BTree tree, Comparable obj, int dimension, Object valueReturn)
     Gets all the uniqueIds that do not equal the object for a dimension.
public static  Maprange(BTree tree, Comparable startObj, Comparable endObj, int dimension, boolean inclusive)
     Gets all the uniqueIds that fall between the two objects for a dimension.
public static  Maprange(BTree tree, Comparable startObj, Comparable endObj, int dimension, boolean inclusive, Object alias)
     Gets all the uniqueIds that fall between the two objects for a dimension.
public static  voidremoveValue(BTree tree, Object uniqueId, Comparable object, int dimension)
     Removes a particular uniqueId from the tree if it is indexed with that value and dimension.
public static  voidremoveValueObject(BTree tree, Object uniqueId, Comparable object)
     Removes a particular uniqueId from the tree if it is indexed with that valueObject.



Method Detail
contains
public static boolean contains(BTree tree, Comparable obj, int dimension) throws JoftiException(Code)
Checks if the tree contains a particular value in a dimension. This does not check if any uniqueIds are stored against the value.


Parameters:
  tree - - the tree to perform the search upon.

Parameters:
  obj - - the object to search for.

Parameters:
  dimension - - the dimension that the value is in.
the Map of results.

throws:
  JoftiException -




getAllResultsForDimension
public static Map getAllResultsForDimension(BTree tree, int dimension) throws JoftiException(Code)
Gets a collection of all uniqueIds in tree for a specific dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  dimension - - the dimension where the key is by type. - a Collection of all the matching values
throws:
  JoftiException -




getAllValuesForKey
public static Collection getAllValuesForKey(BTree tree, Comparable obj, int startDimension) throws JoftiException(Code)
Gets a collection of all value/dimension matches in the tree for a specific uniqueid. This method is used when we have a uniqueId and no object left in the cache (due to expiry etc) and so the only alternative is a scan of the leaf nodes to find matches. This is very inefficient if there are a lot of values in the tree but some cache implementations leave us with no alternative, as there are no callbacks for some events.


Parameters:
  tree - - the Tree to search
Parameters:
  obj - - the unique id to look for
Parameters:
  startDimension - - the dimension where the key is by type. - a Collection of all the matching values that has the uniqueId
throws:
  JoftiException -




getHighestNodeForDimension
public static INode getHighestNodeForDimension(BTree tree, int dimension) throws JoftiException(Code)
Gets the node containing the last entry for a dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  dimension - - the dimension where the key is by type. - the starting node
throws:
  JoftiException -




getKeyAttributes
public static Collection getKeyAttributes(BTree tree, Comparable obj, int dimension) throws JoftiException(Code)
Returns the keys that are mapped against the comparable value.
Parameters:
  tree -
Parameters:
  obj -
Parameters:
  dimension -
throws:
  JoftiException -



getLowestNodeForDimension
public static INode getLowestNodeForDimension(BTree tree, int dimension) throws JoftiException(Code)
Gets the node containing the first entry for a dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  dimension - - the dimension where the key is by type. - the starting node
throws:
  JoftiException -




getSubTreeKeyValues
public static Map getSubTreeKeyValues(BTree tree, Comparable startObj, Comparable endObj, int dimension, int endDimension, boolean inclusive) throws JoftiException(Code)
Gets all the uniqueIds that are contained in the tree between two values irrespective of the dimension. If the startObj is NULL it is assumed that the lower range starts from the first value in the dimension. Similarly, if the endObj is NULL it is assumed the upper bound is the maximum value in the dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  startObj - - the starting value for the range search
Parameters:
  endObj - - the end value for the range search
Parameters:
  startdimension - - the dimension of the startObj.
Parameters:
  enddimension - - the dimension of the end Obj.
Parameters:
  inclusive - - sets whether the range search should be inclusive of the start and end objects. - A Map of the results.
throws:
  JoftiException -




insertKeyValue
public static void insertKeyValue(BTree tree, Comparable key, Map attributes, int dimension) throws JoftiException(Code)
Inserts a key and the object attributes in the tree using a specific key dimension. The key/attributes/dimension are grouped into a leaf node entry.

This method delegates the insert to the BTree insert method.


Parameters:
  tree - - the tree to insert the value into

Parameters:
  key - - the key to use as the unique id

Parameters:
  object - - the value to be inserted into the tree. This must be Comparable.

Parameters:
  dimension - - the dimension that this value is part of.


throws:
  JoftiException - a wrapping exception to trap errors in the tree.




insertValue
public static void insertValue(BTree tree, Comparable key, Comparable object, int dimension) throws JoftiException(Code)
Inserts a value in the tree using a specific dimension. The key/value/dimension are grouped into a leaf node entry as a single entity.

This method delegates the insert to the BTree insert method.


Parameters:
  tree - - the tree to insert the value into

Parameters:
  key - - the key to use as the unique id

Parameters:
  object - - the value to be inserted into the tree. This must be Comparable.

Parameters:
  dimension - - the dimension that this value is part of.


throws:
  JoftiException - a wrapping exception to trap errors in the tree.




match
public static Map match(BTree tree, Comparable obj, int dimension) throws JoftiException(Code)
Retrieves the matching uniqueIds for a particular value and dimension (if any). Failure to find a match returns an empty Map.


Parameters:
  tree - - the tree to perform the search upon.

Parameters:
  obj - - the object to search for.

Parameters:
  dimension - - the dimension that the value is in.
the Map of results.

throws:
  JoftiException -




match
public static Map match(BTree tree, Comparable obj, int dimension, Object valueReturn) throws JoftiException(Code)
Retrieves the matching uniqueIds for a particular value and dimension (if any). The valueReturn object is used to specify what field alias we should be looking for against this ID. Failure to find a match returns an empty Map.


Parameters:
  tree - - the tree to perform the search upon.

Parameters:
  obj - - the object to search for.

Parameters:
  dimension - - the dimension that the value is in.

Parameters:
  valueReturn - - The alias value of the object to return or null if we do not want to indicate a return restriction.
the Map of results.

throws:
  JoftiException -




match
public static Map match(BTree tree, Comparable[] obj, int dimension) throws JoftiException(Code)
Retrieves the matching uniqueIds for a particular array of values and dimension (if any). Failure to find a match returns an empty Map.


Parameters:
  tree - - the tree to perofrm the search upon.

Parameters:
  obj - - the object to search for.

Parameters:
  dimension - - the dimension that the value is in.
the Map of results.

throws:
  JoftiException -




match
public static Map match(BTree tree, Comparable[] obj, int dimension, Object alias) throws JoftiException(Code)
Retrieves the matching uniqueIds for a particular array of values and dimension (if any). The alias is used to pecify which alis we should use for the id. Failure to find a match returns an empty Map.


Parameters:
  tree - - the tree to perform the search upon.

Parameters:
  obj - - the object array containing the objects to search for.

Parameters:
  dimension - - the dimension that the value is in.

Parameters:
  alias - - The alias value of the object to return or null if we do not want to indicate a return restriction.
the Map of results.

throws:
  JoftiException -




notEqual
public static Map notEqual(BTree tree, Comparable obj, int dimension, Object valueReturn) throws JoftiException(Code)
Gets all the uniqueIds that do not equal the object for a dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  obj - - the value we want to exclude
Parameters:
  dimension - - the dimension of the object. - the starting node
throws:
  JoftiException -




range
public static Map range(BTree tree, Comparable startObj, Comparable endObj, int dimension, boolean inclusive) throws JoftiException(Code)
Gets all the uniqueIds that fall between the two objects for a dimension. If the startObj is NULL it is assumed that the lower range starts from the first value in the dimension. Similarly, if the endObj is NULL it is assumed the upper bound is the maximum value in the dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  startObj - - the starting value for the range search
Parameters:
  endObj - - the end value for the range search
Parameters:
  dimension - - the dimension where the key is by type.
Parameters:
  inclusive - - sets whether the range search should be inclusive of the start and end objects. - A Map of the results.
throws:
  JoftiException -




range
public static Map range(BTree tree, Comparable startObj, Comparable endObj, int dimension, boolean inclusive, Object alias) throws JoftiException(Code)
Gets all the uniqueIds that fall between the two objects for a dimension. If the startObj is NULL it is assumed that the lower range starts from the first value in the dimension. Similarly, if the endObj is NULL it is assumed the upper bound is the maximum value in the dimension.


Parameters:
  tree - - the Tree to search
Parameters:
  startObj - - the starting value for the range search
Parameters:
  endObj - - the end value for the range search
Parameters:
  dimension - - the dimension where the key is by type.
Parameters:
  inclusive - - sets whether the range search should be inclusive of the start and end objects.
Parameters:
  alias - - passed back in the result map as the value to indicate what fields the key should filter on. - a Map of the results.
throws:
  JoftiException -




removeValue
public static void removeValue(BTree tree, Object uniqueId, Comparable object, int dimension) throws JoftiException(Code)
Removes a particular uniqueId from the tree if it is indexed with that value and dimension. If the value exists but the uniqueId is not stored with the value then no remove is performed. Otherwise the the uniqueid is removed from the value's id set.


Parameters:
  tree - - the tree to operate on.

Parameters:
  uniqueId - - the uniqueId to remove

Parameters:
  object - - the value to look for in the tree

Parameters:
  dimension - - the dimension that the value is in.

throws:
  JoftiException -




removeValueObject
public static void removeValueObject(BTree tree, Object uniqueId, Comparable object) throws JoftiException(Code)
Removes a particular uniqueId from the tree if it is indexed with that valueObject. If the value exists but the uniqueId is not stored with the value then no remove is performed. Otherwise the the uniqueid is removed from the value's id set.


Parameters:
  tree - - the tree to operate on.

Parameters:
  uniqueId - - the uniqueId to remove

Parameters:
  object - - the value to look for in the tree

throws:
  JoftiException -




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.