it.unimi.di.mg4j.document
Class AbstractDocumentFactory

java.lang.Object
  extended by it.unimi.di.mg4j.document.AbstractDocumentFactory
All Implemented Interfaces:
DocumentFactory, FlyweightPrototype<DocumentFactory>, Serializable
Direct Known Subclasses:
CompositeDocumentFactory, PropertyBasedDocumentFactory, ReplicatedDocumentFactory, SubDocumentFactory, TRECHeaderDocumentFactory, ZipDocumentCollection.ZipFactory

public abstract class AbstractDocumentFactory
extends Object
implements DocumentFactory

An abstract implementation of a factory, providing a protected method to check for field indices.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface it.unimi.di.mg4j.document.DocumentFactory
DocumentFactory.FieldType
 
Constructor Summary
AbstractDocumentFactory()
           
 
Method Summary
protected  void ensureFieldIndex(int index)
          Checks that the index is correct (between 0, inclusive, and DocumentFactory.numberOfFields(), exclusive), and throws an IndexOutOfBoundsException if the index is not correct.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.di.mg4j.document.DocumentFactory
copy, fieldIndex, fieldName, fieldType, getDocument, numberOfFields
 

Constructor Detail

AbstractDocumentFactory

public AbstractDocumentFactory()
Method Detail

ensureFieldIndex

protected void ensureFieldIndex(int index)
Checks that the index is correct (between 0, inclusive, and DocumentFactory.numberOfFields(), exclusive), and throws an IndexOutOfBoundsException if the index is not correct.

Parameters:
index - the index to be checked.

toString

public String toString()
Overrides:
toString in class Object