org.nuiton.wikitty.search
Class PagedResult<T>

java.lang.Object
  extended by org.nuiton.wikitty.search.PagedResult<T>
Type Parameters:
T - paged result value type
All Implemented Interfaces:
Serializable, Iterable<T>

Deprecated. since 3.3 use new query api WikittyQuery

@Deprecated
public class PagedResult<T>
extends Object
implements Serializable, Iterable<T>

Paged result containing result collection and facet topics.

Version:
$Revision: 1259 $ Last update: $Date: 2011-12-28 19:50:45 +0100 (Wed, 28 Dec 2011) $ by : $Author: bpoussin $
Author:
poussin
See Also:
Serialized Form

Field Summary
protected  String criteriaName
          Deprecated. nom du critere qui a ete uitilise (peut-etre null) si le critete n'avait pas de nom
protected  Map<String,List<FacetTopic>> facets
          Deprecated. facet asked or null if no facet
protected  Map<String,Map<String,FacetTopic>> facetsAsMap
          Deprecated. facet asked of null if no facet, FacetTopic are put in map with key topic name, To use this variable, you must used getter, because, this variable is lazy loaded from facets variable.
protected  int firstIndice
          Deprecated. indice element in global search result
protected  int numFound
          Deprecated. total number of result if we call the query for all possible result
protected  String queryString
          Deprecated. query really executed
protected  List<T> results
          Deprecated. list of result in the wanted interval
 
Constructor Summary
PagedResult(String criteriaName, int firstIndice, int numFound, String queryString, Map<String,List<FacetTopic>> facets, List<T> results)
          Deprecated. Init paged result.
 
Method Summary
 PagedResult<Wikitty> cast(String securityToken, WikittyService ws)
          Deprecated. Convert all result to the wikitty type and return new PagedResult with this new result list.
<E extends BusinessEntityImpl>
PagedResult<E>
cast(WikittyProxy proxy, Class<E> clazz)
          Deprecated. Call cast(WikittyProxy, Class, boolean) with autoconvert = true
<E extends BusinessEntityImpl>
PagedResult<E>
cast(WikittyProxy proxy, Class<E> clazz, boolean autoconvert)
          Deprecated. Convert all result to the wanted type and return new PagedResult with this new result list.
 T get(int i)
          Deprecated. Return element at index.
 List<T> getAll()
          Deprecated. Return unmodifiable list of all result.
 String getCriteriaName()
          Deprecated.  
 Collection<String> getFacetNames()
          Deprecated. Return name of all facet used in query.
 Map<String,List<FacetTopic>> getFacets()
          Deprecated. Get map represent facets.
 Map<String,Map<String,FacetTopic>> getFacetsAsMap()
          Deprecated.  
 T getFirst()
          Deprecated. Return the first element in result Can throw an exception if no element available
 int getFirstIndice()
          Deprecated.  
 int getNumFound()
          Deprecated.  
 String getQueryString()
          Deprecated.  
 List<FacetTopic> getTopic(String facetName)
          Deprecated. Return all topic for the specified facet.
 FacetTopic getTopic(String facetName, String topicName)
          Deprecated. Return topic for the specified facet and topic name.
 int getTopicCount(String facetName, String topicName)
          Deprecated. Return topic count for the specified facet and topic name.
 Iterator<T> iterator()
          Deprecated. Iterate on result, same as getAll().iterator().
 int size()
          Deprecated. Return the number of result in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

criteriaName

protected String criteriaName
Deprecated. 
nom du critere qui a ete uitilise (peut-etre null) si le critete n'avait pas de nom


firstIndice

protected int firstIndice
Deprecated. 
indice element in global search result


numFound

protected int numFound
Deprecated. 
total number of result if we call the query for all possible result


queryString

protected String queryString
Deprecated. 
query really executed


results

protected List<T> results
Deprecated. 
list of result in the wanted interval


facets

protected Map<String,List<FacetTopic>> facets
Deprecated. 
facet asked or null if no facet


facetsAsMap

protected Map<String,Map<String,FacetTopic>> facetsAsMap
Deprecated. 
facet asked of null if no facet, FacetTopic are put in map with key topic name, To use this variable, you must used getter, because, this variable is lazy loaded from facets variable.

Constructor Detail

PagedResult

public PagedResult(String criteriaName,
                   int firstIndice,
                   int numFound,
                   String queryString,
                   Map<String,List<FacetTopic>> facets,
                   List<T> results)
Deprecated. 
Init paged result. we don't initialize securityToken

Parameters:
firstIndice - indice element in global search result
numFound - total number of result if we call the query for all possible result
queryString - query really executed
facets - facet asked or null if no facet
results - list of result in the wanted interval
Method Detail

cast

public <E extends BusinessEntityImpl> PagedResult<E> cast(WikittyProxy proxy,
                                                          Class<E> clazz)
Deprecated. 
Call cast(WikittyProxy, Class, boolean) with autoconvert = true

Parameters:
proxy - used to retrieve securityToken and WikittyService
clazz - target PagedResult type
Returns:
new PagedResult, this result can have less elements that original for some reason (security, ...)

cast

public PagedResult<Wikitty> cast(String securityToken,
                                 WikittyService ws)
Deprecated. 
Convert all result to the wikitty type and return new PagedResult with this new result list.

Parameters:
securityToken - security token
ws - wikitty service
Returns:
new PagedResult, this result can have less elements that original for some reason (security, ...)

cast

public <E extends BusinessEntityImpl> PagedResult<E> cast(WikittyProxy proxy,
                                                          Class<E> clazz,
                                                          boolean autoconvert)
Deprecated. 
Convert all result to the wanted type and return new PagedResult with this new result list. If some result don't have the right extension (clazz) this extension is automatically added if autoconvert is true. Else an exception is thrown when result without extension is found. When you used autoconvert = false, you have a potentially problem when you have modified a BusinessEntity to have new extension and all your wikitty object are not uptodate in database.

Type Parameters:
E - class to cast into
Parameters:
proxy - used to retrieve securityToken and WikittyService
autoconvert - if autoconvert is false and object don't all needed extension, object is not put in the result
Returns:
new PagedResult, this result can have less elements that original for some reason (security, ...)

getCriteriaName

public String getCriteriaName()
Deprecated. 

getFirstIndice

public int getFirstIndice()
Deprecated. 

getNumFound

public int getNumFound()
Deprecated. 

getQueryString

public String getQueryString()
Deprecated. 

getFacetNames

public Collection<String> getFacetNames()
Deprecated. 
Return name of all facet used in query.

Returns:
result's facets names

getTopic

public List<FacetTopic> getTopic(String facetName)
Deprecated. 
Return all topic for the specified facet.

Parameters:
facetName - name of the wanted facet
Returns:
facet's topics

getTopic

public FacetTopic getTopic(String facetName,
                           String topicName)
Deprecated. 
Return topic for the specified facet and topic name.

Parameters:
facetName - name of the wanted facet
topicName - name of the wanted topic
Returns:
topic

getTopicCount

public int getTopicCount(String facetName,
                         String topicName)
Deprecated. 
Return topic count for the specified facet and topic name. If facet or topic don't exist, return 0.

Parameters:
facetName - name of the wanted facet
topicName - name of the wanted topic
Returns:
topic count or 0

getFacets

public Map<String,List<FacetTopic>> getFacets()
Deprecated. 
Get map represent facets.

Returns:
all facets

getFacetsAsMap

public Map<String,Map<String,FacetTopic>> getFacetsAsMap()
Deprecated. 

getFirst

public T getFirst()
Deprecated. 
Return the first element in result Can throw an exception if no element available

Returns:
first element

get

public T get(int i)
Deprecated. 
Return element at index.

Parameters:
i - index
Returns:
element at index

getAll

public List<T> getAll()
Deprecated. 
Return unmodifiable list of all result.

Returns:
all results

size

public int size()
Deprecated. 
Return the number of result in this object.

Returns:
result number

iterator

public Iterator<T> iterator()
Deprecated. 
Iterate on result, same as getAll().iterator().

Specified by:
iterator in interface Iterable<T>
Returns:


Copyright © 2009-2012 CodeLutin. All Rights Reserved.