using System; using System.Collections.Generic; using System.Text; namespace ScrewTurn.Wiki.SearchEngine { /// /// Represents a change occurred to the index, structured for easy dumping to disk or database. /// /// The class is not thread-safe. public class DumpedChange { /// /// The dumped document data. /// protected DumpedDocument document; /// /// The list of dumped words data. /// protected List words; /// /// The list of dumped mappings data. /// protected List mappings; /// /// Initializes a new instance of the class. /// /// The dumped document data. /// The list of dumped words data. /// The list of dumped mappings data. /// If , or are null. public DumpedChange(DumpedDocument document, List words, List mappings) { if(document == null) throw new ArgumentNullException("document"); if(words == null) throw new ArgumentNullException("words"); if(mappings == null) throw new ArgumentNullException("mappings"); // mappings can be empty if the document did not have any indexable content //if(mappings.Count == 0) throw new ArgumentException("Mappings cannot be empty", "mappings"); this.document = document; this.words = words; this.mappings = mappings; } /// /// Gets the dumped document data. /// public DumpedDocument Document { get { return document; } } /// /// Gets the list of dumped words data. /// public List Words { get { return words; } } /// /// Gets the list of dumped mappings data. /// public List Mappings { get { return mappings; } } } }