it.unimi.dsi.archive4j
Class ArchiveWriter<T extends DocumentSummary>

java.lang.Object
  extended by it.unimi.dsi.archive4j.ArchiveWriter<T>
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
ArrayArchive, BitstreamArchiveWriter

public abstract class ArchiveWriter<T extends DocumentSummary>
extends Object
implements Closeable

An abstract archive writer.

Concrete implementations of this class must implement append(DocumentSummary), which appends a summary to the archive, and Closeable.close(), which finalizes the archive. It is strongly suggested that the ArchiveLoader properties convention is followed.

Users of concrete implementations must create an instance, append the relevant summaries, and close the archive.

Author:
Alessio Orlandi, Sebastiano Vigna

Constructor Summary
ArchiveWriter()
           
 
Method Summary
abstract  void append(T summary)
          Appends a new document summary to the archive.
 void appendAll(Iterable<T> collection)
          Appends an entire collection to the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

ArchiveWriter

public ArchiveWriter()
Method Detail

append

public abstract void append(T summary)
                     throws IOException
Appends a new document summary to the archive.

Parameters:
summary - a document summary.
Throws:
IOException

appendAll

public void appendAll(Iterable<T> collection)
               throws IOException
Appends an entire collection to the archive.

This implementation repeatedly calls append(DocumentSummary).

Throws:
IOException