Java Doc for IndexWriter.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.IndexWriter

All known Subclasses:   it.unimi.dsi.mg4j.index.AbstractBitStreamIndexWriter,  it.unimi.dsi.mg4j.index.BitStreamHPIndexWriter,
IndexWriter
public interface IndexWriter (Code)
An interface for classes that generate indices.

Implementations of this interface are used to write inverted lists in sequential order, as follows:

IndexWriter.newDocumentRecord() returns an OutputBitStream that must be used to write the document-record data. Note that there is no guarantee that the returned OutputBitStream coincides with the underlying bit stream. Moreover, there is no guarantee as to when the bits will be actually written on the underlying stream, except that when starting a new inverted list, the previous inverted list, if any, will be written onto the underlying stream.
author:
   Paolo Boldi
author:
   Sebastiano Vigna
since:
   1.2





Method Summary
 voidclose()
     Closes this index writer, completing the index creation process and releasing all resources.
 OutputBitStreamnewDocumentRecord()
     Starts a new document record.
 longnewInvertedList()
     Starts a new inverted list.
 voidprintStats(PrintStream stats)
     Writes to the given print stream statistical information about the index just built.
 Propertiesproperties()
     Returns properties of the index generated by this index writer.

This method should only be called after IndexWriter.close() .

 intwriteDocumentPointer(OutputBitStream out, int pointer)
     Writes a document pointer.

This method must be called immediately after IndexWriter.newDocumentRecord() .
Parameters:
  out - the output bit stream where the pointer will be written.
Parameters:
  pointer - the document pointer.

 intwriteDocumentPositions(OutputBitStream out, int[] occ, int offset, int len, int docSize)
     Writes the positions of the occurrences of the current term in the current document to the given OutputBitStream .
 intwriteFrequency(int frequency)
     Writes the frequency.
Parameters:
  frequency - the (positive) number of document records that this inverted list will contain.
 intwritePayload(OutputBitStream out, Payload payload)
     Writes the payload for the current document.

This method must be called immediately after IndexWriter.writeDocumentPointer(OutputBitStream,int) .
Parameters:
  out - the output bit stream where the payload will be written.
Parameters:
  payload - the payload.

 intwritePositionCount(OutputBitStream out, int count)
     Writes the count of the occurrences of the current term in the current document to the given OutputBitStream .
 longwrittenBits()
     Returns the overall number of bits written onto the underlying stream(s).



Method Detail
close
void close() throws IOException(Code)
Closes this index writer, completing the index creation process and releasing all resources.
throws:
  IllegalStateException - if too few records were written for the last inverted list.



newDocumentRecord
OutputBitStream newDocumentRecord() throws IOException(Code)
Starts a new document record.

This method must be called exactly exactly f times, where f is the frequency specified with IndexWriter.writeFrequency(int) . the output bit stream where the next document record data should be written.
throws:
  IllegalStateException - if too many records were written for the current inverted list,or if there is no current inverted list.




newInvertedList
long newInvertedList() throws IOException(Code)
Starts a new inverted list. The previous inverted list, if any, is actually written to the underlying bit stream. the position (in bytes) of the underlying bit stream where the new invertedlist starts.
throws:
  IllegalStateException - if too few records were written for the previous invertedlist.



printStats
void printStats(PrintStream stats)(Code)
Writes to the given print stream statistical information about the index just built. This method must be called after IndexWriter.close() .
Parameters:
  stats - a print stream where statistical information will be written.



properties
Properties properties()(Code)
Returns properties of the index generated by this index writer.

This method should only be called after IndexWriter.close() . It returns a new containing values for (whenever appropriate) Index.PropertyKeys.DOCUMENTS , Index.PropertyKeys.TERMS , Index.PropertyKeys.POSTINGS , Index.PropertyKeys.MAXCOUNT , Index.PropertyKeys.INDEXCLASS , Index.PropertyKeys.CODING , Index.PropertyKeys.PAYLOADCLASS , BitStreamIndex.PropertyKeys.SKIPQUANTUM , and BitStreamIndex.PropertyKeys.SKIPHEIGHT . properties a new set of properties for the just created index.




writeDocumentPointer
int writeDocumentPointer(OutputBitStream out, int pointer) throws IOException(Code)
Writes a document pointer.

This method must be called immediately after IndexWriter.newDocumentRecord() .
Parameters:
  out - the output bit stream where the pointer will be written.
Parameters:
  pointer - the document pointer. the number of bits written.




writeDocumentPositions
int writeDocumentPositions(OutputBitStream out, int[] occ, int offset, int len, int docSize) throws IOException(Code)
Writes the positions of the occurrences of the current term in the current document to the given OutputBitStream .
Parameters:
  out - the output stream where the occurrences should be written.
Parameters:
  occ - the position vector (a sequence of strictly increasing natural numbers).
Parameters:
  offset - the first valid entry in occ.
Parameters:
  len - the number of valid entries in occ.
Parameters:
  docSize - the size of the current document (only for Golomb and interpolative coding; you can safely pass -1 otherwise). the number of bits written.
throws:
  IllegalStateException - if there is no current inverted list.



writeFrequency
int writeFrequency(int frequency) throws IOException(Code)
Writes the frequency.
Parameters:
  frequency - the (positive) number of document records that this inverted list will contain. the number of bits written.



writePayload
int writePayload(OutputBitStream out, Payload payload) throws IOException(Code)
Writes the payload for the current document.

This method must be called immediately after IndexWriter.writeDocumentPointer(OutputBitStream,int) .
Parameters:
  out - the output bit stream where the payload will be written.
Parameters:
  payload - the payload. the number of bits written.




writePositionCount
int writePositionCount(OutputBitStream out, int count) throws IOException(Code)
Writes the count of the occurrences of the current term in the current document to the given OutputBitStream .
Parameters:
  out - the output stream where the occurrences should be written.
Parameters:
  count - the count. the number of bits written.



writtenBits
long writtenBits()(Code)
Returns the overall number of bits written onto the underlying stream(s). the number of bits written, according to the variables keeping statistical records.



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