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


it.unimi.dsi.mg4j.index.IndexIterator

All known Subclasses:   it.unimi.dsi.mg4j.index.cluster.DocumentalMergedClusterIndexIterator,  it.unimi.dsi.mg4j.index.AbstractIndexIterator,  it.unimi.dsi.mg4j.index.MultiTermIndexIterator,  it.unimi.dsi.mg4j.index.cluster.DocumentalConcatenatedClusterIndexIterator,  test.it.unimi.dsi.mg4j.search.IntArrayIndexIterator,
IndexIterator
public interface IndexIterator extends DocumentIterator(Code)
An iterator over an inverted list.

An index iterator scans the inverted list of an indexed term. Each integer returned by DocumentIterator.nextDocument nextDocument() is the index of a document containing the term. If the index contains counts, they can be obtained after each call to IndexIterator.nextDocument() using IndexIterator.count() . Then, if the index contains positions they can be obtained as an array using IndexIterator.positionArray() , as an iterator using IndexIterator.positions() , or stored into an array using IndexIterator.positions(int[]) .

Note that this interface extends it.unimi.dsi.mg4j.search.DocumentIterator . The intervals returned for a document are exactly length-one intervals corresponding to the positions returned by IndexIterator.positions() . If the index to which an instance of this class refers does not contain positions, an UnsupportedOperationException will be thrown.





Method Summary
public  intcount()
     Returns the count, that is, the number of occurrences of the term in the current document.
public  intfrequency()
     Returns the frequency, that is, the number of documents that will be returned by this iterator.
public  voidid(int id)
     Sets the id of this index iterator.

The id is an integer associated to each index iterator.

public  intid()
     Returns the id of this index iterator.
public  Indexindex()
     Returns the index over which this iterator is built.
public  Payloadpayload()
     Returns the payload, if any, associated with the current document.
public  int[]positionArray()
     Returns the positions at which the term appears in the current document in an array.
public  IntIteratorpositions()
     Returns the positions at which the term appears in the current document.
public  intpositions(int[] positions)
     Stores the positions at which the term appears in the current document in a given array.
public  Stringterm()
     Returns the term whose inverted list is returned by this index iterator.
public  voidterm(CharSequence term)
     Sets the term whose inverted list is returned by this index iterator.
public  inttermNumber()
     Returns the number of the term whose inverted list is returned by this index iterator.

Usually, the term number is automatically set by IndexReader.documents(CharSequence) or IndexReader.documents(int) . Instances of Index.EmptyIndexIterator can return -1. the number of the term over which this iterator is built, or -1 for an Index.EmptyIndexIterator.




Method Detail
count
public int count() throws IOException(Code)
Returns the count, that is, the number of occurrences of the term in the current document. the count (number of occurrences) of the term in the current document.
throws:
  UnsupportedOperationException - if the index of this iterator does not contain counts.



frequency
public int frequency() throws IOException(Code)
Returns the frequency, that is, the number of documents that will be returned by this iterator. the number of documents that will be returned by this iterator.



id
public void id(int id)(Code)
Sets the id of this index iterator.

The id is an integer associated to each index iterator. It has no specific semantics, and can be used differently in different contexts. A typical usage pattern, for instance, is using it to assign a unique number to the index iterators contained in a composited document iterator (say, numbering consecutively the leaves of the composite).

Instances of Index.EmptyIndexIterator are allowed to ignore silently calls to this method.
Parameters:
  id - the new id for this index iterator.




id
public int id()(Code)
Returns the id of this index iterator.

Instances of Index.EmptyIndexIterator are allowed to return -1.
See Also:   IndexIterator.id(int) the id of this index iterator.




index
public Index index()(Code)
Returns the index over which this iterator is built. the index over which this iterator is built.



payload
public Payload payload() throws IOException(Code)
Returns the payload, if any, associated with the current document. the payload associated with the current document.



positionArray
public int[] positionArray() throws IOException(Code)
Returns the positions at which the term appears in the current document in an array.

Implementations are allowed to return the same array across different calls to this method. an array whose first elements contain the document positions.
throws:
  UnsupportedOperationException - if the index of this iterator does not contain positions.




positions
public IntIterator positions() throws IOException(Code)
Returns the positions at which the term appears in the current document. the positions of the current document in which the current term appears.
throws:
  UnsupportedOperationException - if the index of this iterator does not contain positions.



positions
public int positions(int[] positions) throws IOException(Code)
Stores the positions at which the term appears in the current document in a given array.

If the array is not large enough (i.e., it does not contain IndexIterator.count() elements), this method will return a negative number (the opposite of the count).
Parameters:
  positions - an array that will be used to store positions. the ; it will have the sign changed if positions cannothold all positions.
throws:
  UnsupportedOperationException - if the index of this iterator does not contain positions.




term
public String term()(Code)
Returns the term whose inverted list is returned by this index iterator.

Usually, the term is automatically set by IndexReader.documents(CharSequence) or IndexReader.documents(int) , but you can supply your own term with IndexIterator.term(CharSequence) .

Instances of Index.EmptyIndexIterator can return null. the term over which this iterator is built, as a compact mutable string.
throws:
  IllegalStateException - if no term was set when the iterator was created.
See Also:   IndexIterator.termNumber()




term
public void term(CharSequence term)(Code)
Sets the term whose inverted list is returned by this index iterator.

Usually, the term is automatically set by Index.documents(CharSequence) or by IndexReader.documents(CharSequence) , but you can use this method to ensure that IndexIterator.term() doesn't throw an exception.

Instances of Index.EmptyIndexIterator are allowed to ignore silently calls to this method.
Parameters:
  term - a character sequence (that will be defensively copied)that will be assumed to be the term whose inverted list is returned by this index iterator.




termNumber
public int termNumber()(Code)
Returns the number of the term whose inverted list is returned by this index iterator.

Usually, the term number is automatically set by IndexReader.documents(CharSequence) or IndexReader.documents(int) . Instances of Index.EmptyIndexIterator can return -1. the number of the term over which this iterator is built, or -1 for an Index.EmptyIndexIterator.
throws:
  IllegalStateException - if no term was set when the iterator was created.
See Also:   IndexIterator.term()




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