org.sourceforge.beanindex.search
Class Hits

java.lang.Object
  extended byorg.sourceforge.beanindex.search.Hits

public final class Hits
extends java.lang.Object

This Hits is not Serializable and It is deliberately done so. Keeping Hits in a HttpSession may result in exceptions if Session persistance enabled on the WebServer. Please use a Wrapper class with transient variable holding Hits for storing it in HttpSession. If result hit number is larger ex 5000 and more, use searchresult as a throwaway type object. Each hit id takes 4 bytes of RAM. Keeping searchresult in HttpSession may result in higher memory usage.

Author:
Sakthivel Muthusamy

Method Summary
 java.lang.Object[] getBeans(Index index)
          Returns all the beans in this result
 java.lang.Object[] getBeans(Index index, int offset, int length)
          returns the Beans
 int[] getHitBeanIds(Index index)
          Returns the Bean ids Bean ids are assigned and returned in FIFO order.
 int[] getHitBeanIds(Index index, int offset, int length)
          returns the Bean ids ids are in FIFO order
 int getHitCount(Index index)
          returns the size of the search result for the index
 int getTotalHitCount()
          Returns the size of the search result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBeans

public java.lang.Object[] getBeans(Index index)
                            throws StaleObjectException,
                                   BeanIndexException
Returns all the beans in this result

Parameters:
index -
Returns:
Object[]
Throws:
StaleObjectException
BeanIndexException

getBeans

public java.lang.Object[] getBeans(Index index,
                                   int offset,
                                   int length)
                            throws StaleObjectException,
                                   BeanIndexException
returns the Beans

Parameters:
index -
offset -
length -
Returns:
Object[]
Throws:
StaleObjectException
BeanIndexException

getHitBeanIds

public int[] getHitBeanIds(Index index)
Returns the Bean ids Bean ids are assigned and returned in FIFO order.

Parameters:
index -
Returns:
int[]

getHitBeanIds

public int[] getHitBeanIds(Index index,
                           int offset,
                           int length)
returns the Bean ids ids are in FIFO order

Parameters:
index -
offset -
length -
Returns:
int[]

getTotalHitCount

public int getTotalHitCount()
Returns the size of the search result

Returns:
int

getHitCount

public int getHitCount(Index index)
returns the size of the search result for the index

Parameters:
index -
Returns:
int