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


java.lang.Object
   it.unimi.dsi.mg4j.document.ZipDocumentCollectionBuilder

ZipDocumentCollectionBuilder
public class ZipDocumentCollectionBuilder (Code)
A builder to create ZipDocumentCollection s.

After creating an instance of this class, it is possible to add incrementally new documents. Each document must be started with ZipDocumentCollectionBuilder.startDocument(CharSequence,CharSequence) and ended with ZipDocumentCollectionBuilder.endDocument() ; inside each document, each non-text field must be written by passing an object to ZipDocumentCollectionBuilder.nonTextField(Object) , whereas each text field must be started with ZipDocumentCollectionBuilder.startTextField() and ended with ZipDocumentCollectionBuilder.endTextField() : inbetween, a call to ZipDocumentCollectionBuilder.add(MutableString,MutableString) must be made for each word/nonword pair retrieved from the original collection. At the end, ZipDocumentCollectionBuilder.close() returns a it.unimi.dsi.mg4j.document.ZipDocumentCollection that must be serialised.

Alternatively, you can just call ZipDocumentCollectionBuilder.build(DocumentSequence) and all the above will be handled for you.

Each Zip entry corresponds to a document: the title is recorded in the comment field, whereas the URI is written with MutableString.writeSelfDelimUTF8(java.io.OutputStream) directly to the zipped output stream. When building an exact subsequent word/nonword pairs are written in the same way, and delimited by two empty strings. If the collection is not exact, just words are written, and delimited by an empty string. Non-text fields are written directly to the zipped output stream.




Constructor Summary
public  ZipDocumentCollectionBuilder(String zipFilename, DocumentFactory factory, boolean exact, ProgressLogger progressLogger)
     Creates a new zipped collection builder.

Method Summary
public  voidadd(MutableString word, MutableString nonWord)
     Adds a word and a nonword to the current text field, provided that a text field has but not yet ; otherwise, doesn't do anything.
public  ZipDocumentCollectionbuild(DocumentSequence inputSequence)
     A utility method copying all documents of an input sequence to a zipped collection.
public  ZipDocumentCollectionclose()
     Terminates the contruction of the zipped collection and returns it.
public  voidendDocument()
     Ends a document entry.
public  voidendTextField()
     Ends a new text field.
public static  voidmain(String[] arg)
    
public  voidnonTextField(Object o)
     Adds a non-text field.
public  voidstartDocument(CharSequence title, CharSequence uri)
     Starts a document entry.
public  voidstartTextField()
     Starts a new text field.
public  voidvirtualField(ObjectList<VirtualDocumentFragment> fragments)
     Adds a virtual field.


Constructor Detail
ZipDocumentCollectionBuilder
public ZipDocumentCollectionBuilder(String zipFilename, DocumentFactory factory, boolean exact, ProgressLogger progressLogger) throws FileNotFoundException(Code)
Creates a new zipped collection builder.
Parameters:
  zipFilename - the filename of the zip file.
Parameters:
  factory - the factory of the base document sequence.
Parameters:
  exact - true iff also non-words should be preserved.
Parameters:
  progressLogger - a progress logger.




Method Detail
add
public void add(MutableString word, MutableString nonWord) throws IOException(Code)
Adds a word and a nonword to the current text field, provided that a text field has but not yet ; otherwise, doesn't do anything.

Usually, word e nonWord are just the result of a call to WordReader.next(MutableStringMutableString) .
Parameters:
  word - a word.
Parameters:
  nonWord - a nonword.




build
public ZipDocumentCollection build(DocumentSequence inputSequence) throws IOException(Code)
A utility method copying all documents of an input sequence to a zipped collection.



close
public ZipDocumentCollection close() throws IOException(Code)
Terminates the contruction of the zipped collection and returns it.



endDocument
public void endDocument() throws IOException(Code)
Ends a document entry.



endTextField
public void endTextField() throws IOException(Code)
Ends a new text field.



main
public static void main(String[] arg) throws JSAPException, IOException, ClassNotFoundException, InvocationTargetException, NoSuchMethodException, IllegalAccessException, InstantiationException(Code)



nonTextField
public void nonTextField(Object o) throws IOException(Code)
Adds a non-text field.
Parameters:
  o - the content of the non-text field.



startDocument
public void startDocument(CharSequence title, CharSequence uri) throws IOException(Code)
Starts a document entry.
Parameters:
  title - the document title (usually, the result of Document.title).
Parameters:
  uri - the document uri (usually, the result of Document.uri).



startTextField
public void startTextField()(Code)
Starts a new text field.



virtualField
public void virtualField(ObjectList<VirtualDocumentFragment> fragments) throws IOException(Code)
Adds a virtual field.
Parameters:
  fragments - the virtual fragments to be added.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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