Java Doc for AbstractAggregator.java in  » Search-Engine » mg4j » it » unimi » dsi » mg4j » search » score » 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 » mg4j » it.unimi.dsi.mg4j.search.score 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


it.unimi.dsi.mg4j.search.score.AbstractAggregator

All known Subclasses:   it.unimi.dsi.mg4j.search.score.LinearAggregator,
AbstractAggregator
abstract public class AbstractAggregator extends AbstractIntIterator implements Scorer(Code)
A Scorer that aggregates a number of underlying it.unimi.dsi.mg4j.search.score.DelegatingScorer delegating scorers , providing equalisation if required.

An aggregator combines the results of several scorers following some policy (see, e.g., it.unimi.dsi.mg4j.search.score.LinearAggregator ). In doing so, often the aggregator needs to explore the first scores returned by each scorer, and tune some internal parameters. This procedure, equalisation, is supported by this class: if AbstractAggregator.equalize(int) is provided with a positive number of samples, they will be fetched from the underlying document iterator, scored, and passed to the implementing subclass so that equalisation information can be properly set up.

Additionally, this class ensures that if several scorers need access to intervals, the document iterator to be scored is decorated with a it.unimi.dsi.mg4j.search.CachingDocumentIterator , so that several scorer can access intervals.

Since this class uses the same document iterator for all aggregated scorers, they must be necessarily .

Implementing subclasses must provide the following methods:

Additionally, implementing subclasses must remember to call AbstractAggregator.equalize(int) when generating a , so that the state of the aggregator is reproduced correctly.



Field Summary
protected  intactualSamples
     The actual number of samples obtained (might be less than AbstractAggregator.samples if we exhausted the document iterator).
protected  intcurrSample
     The next sample to be returned, if smaller than AbstractAggregator.actualSamples .
final protected  double[]currScore
     The current score.
protected  DocumentIteratordocumentIterator
     The current document iterator.
final protected  intn
     The number of underlying scorers.
final protected  booleanneedsCaching
     Whether we need caching the intervals.
protected  int[]sampleDocument
     Cached sample of document pointers.
protected  double[][]sampleScore
     Cached sample of document scores.
protected  intsamples
     The number of samples for equalisation (0 means no equalisation).
final protected  Scorer[]scorer
     The underlying scorers.

Constructor Summary
public  AbstractAggregator(Scorer[] scorer)
     Creates an aggregator.

Method Summary
public synchronized  voidequalize(int samples)
     Set the number of samples for equalisation.
public  booleanhasNext()
    
public  intnextDocument()
    
public  intnextInt()
    
public  doublescore(Index index)
    
public  doublescore()
    
abstract protected  doublescore(double score)
     Computes an aggregated score using the given array of basic scores. The array is parallel to AbstractAggregator.scorer .
Parameters:
  score - an array of scores.
public synchronized  booleansetWeights(Reference2DoubleMap<Index> index2weight)
     Delegates to the underlying scorers.
abstract protected  voidsetupEqualizationFactors()
     Sets up the equalisation factors.

Implementations should look into AbstractAggregator.sampleScore and set up the equalisation logic.

public  booleanusesIntervals()
     Delegates to the underlying scorers.
public  voidwrap(DocumentIterator documentIterator)
     Delegates to the underlying scorers, possibly wrapping the argument in a CachingDocumentIterator ; then, if AbstractAggregator.samples is nonzero computes that many document scores and invokes AbstractAggregator.setupEqualizationFactors() .

Field Detail
actualSamples
protected int actualSamples(Code)
The actual number of samples obtained (might be less than AbstractAggregator.samples if we exhausted the document iterator).



currSample
protected int currSample(Code)
The next sample to be returned, if smaller than AbstractAggregator.actualSamples .



currScore
final protected double[] currScore(Code)
The current score.



documentIterator
protected DocumentIterator documentIterator(Code)
The current document iterator.



n
final protected int n(Code)
The number of underlying scorers.



needsCaching
final protected boolean needsCaching(Code)
Whether we need caching the intervals.



sampleDocument
protected int[] sampleDocument(Code)
Cached sample of document pointers.



sampleScore
protected double[][] sampleScore(Code)
Cached sample of document scores.



samples
protected int samples(Code)
The number of samples for equalisation (0 means no equalisation).



scorer
final protected Scorer[] scorer(Code)
The underlying scorers.




Constructor Detail
AbstractAggregator
public AbstractAggregator(Scorer[] scorer)(Code)
Creates an aggregator.
Parameters:
  scorer - the scorers.




Method Detail
equalize
public synchronized void equalize(int samples)(Code)
Set the number of samples for equalisation.
Parameters:
  samples - the number of samples to be used to equalise scores; a valueof zero disables equalisation.



hasNext
public boolean hasNext()(Code)



nextDocument
public int nextDocument() throws IOException(Code)



nextInt
public int nextInt()(Code)



score
public double score(Index index)(Code)



score
public double score() throws IOException(Code)



score
abstract protected double score(double score)(Code)
Computes an aggregated score using the given array of basic scores. The array is parallel to AbstractAggregator.scorer .
Parameters:
  score - an array of scores. the aggregated scorer.



setWeights
public synchronized boolean setWeights(Reference2DoubleMap<Index> index2weight)(Code)
Delegates to the underlying scorers. true if at least one underlying scorer supports weights.



setupEqualizationFactors
abstract protected void setupEqualizationFactors()(Code)
Sets up the equalisation factors.

Implementations should look into AbstractAggregator.sampleScore and set up the equalisation logic. Note that this method is responsible for setting up appropriate equalisation factors even if no equalisation is required (e.g., setting all factors to 1 ).




usesIntervals
public boolean usesIntervals()(Code)
Delegates to the underlying scorers. true if at least one underlying scorer uses intervals.



wrap
public void wrap(DocumentIterator documentIterator) throws IOException(Code)
Delegates to the underlying scorers, possibly wrapping the argument in a CachingDocumentIterator ; then, if AbstractAggregator.samples is nonzero computes that many document scores and invokes AbstractAggregator.setupEqualizationFactors() .



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