net.semanticmetadata.lire
Class AbstractDocumentBuilder

java.lang.Object
  extended by net.semanticmetadata.lire.AbstractDocumentBuilder
All Implemented Interfaces:
DocumentBuilder
Direct Known Subclasses:
ChainedDocumentBuilder, CorrelogramDocumentBuilder, SimpleDocumentBuilder

public abstract class AbstractDocumentBuilder
extends java.lang.Object
implements DocumentBuilder

Abstract DocumentBuilder, which uses javax.imageio.ImageIO to create a BufferedImage from an InputStream. This file is part of the Caliph and Emir project: http://www.SemanticMetadata.net
Date: 31.01.2006
Time: 23:07:39

Author:
Mathias Lux, mathias@juggle.at

Field Summary
 
Fields inherited from interface net.semanticmetadata.lire.DocumentBuilder
FIELD_NAME_AUTOCOLORCORRELOGRAM, FIELD_NAME_COLORLAYOUT, FIELD_NAME_EDGEHISTOGRAM, FIELD_NAME_IDENTIFIER, FIELD_NAME_SCALABLECOLOR, MAX_IMAGE_SIDE_LENGTH
 
Constructor Summary
AbstractDocumentBuilder()
           
 
Method Summary
 org.apache.lucene.document.Document createDocument(java.io.InputStream image, java.lang.String identifier)
          Creates a new Lucene document from an InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.semanticmetadata.lire.DocumentBuilder
createDocument
 

Constructor Detail

AbstractDocumentBuilder

public AbstractDocumentBuilder()
Method Detail

createDocument

public org.apache.lucene.document.Document createDocument(java.io.InputStream image,
                                                          java.lang.String identifier)
                                                   throws java.io.IOException
Creates a new Lucene document from an InputStream. The identifier can be used like an id (e.g. the file name or the url of the image). This is a simple implementation using javax.imageio.ImageIO

Specified by:
createDocument in interface DocumentBuilder
Parameters:
image - the image to index. Please note that
identifier - an id for the image, for instance the filename or an URL.
Returns:
a Lucene Document containing the indexed image.
Throws:
java.io.IOException - in case the image cannot be retrieved from the InputStream
See Also:
ImageIO