|
Carrot2 Framework
API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.LocalComponentBase
org.carrot2.core.LocalOutputComponentBase
org.carrot2.core.impl.ArrayOutputComponent
public class ArrayOutputComponent
A utility implementation of an output component that implements RawClustersConsumer and RawDocumentsConsumer interfaces and
collects RawCluster objects and RawDocument objects to two
arrays returned as the result of a process.
| Nested Class Summary | |
|---|---|
static class |
ArrayOutputComponent.Result
An class that stores documents and clusters collected during the processing of a query. |
| Constructor Summary | |
|---|---|
ArrayOutputComponent()
|
|
| Method Summary | |
|---|---|
void |
addCluster(RawCluster cluster)
Adds a cluster to the list of clusters to be returned as the result. |
void |
addDocument(RawDocument doc)
Adds a document to the list of documents to be returned as the result. |
void |
endProcessing()
Provides an empty implementation |
void |
flushResources()
Clears clusters and documents lists and prepares the component for reuse. |
Set |
getComponentCapabilities()
Provides an implementation that has no capabilities (an empty set). |
Set |
getRequiredPredecessorCapabilities()
Provides an implementation that requires no capabilities of the predecessor component. |
Object |
getResult()
|
void |
startProcessing(RequestContext requestContext)
Provides an empty implementation. |
| Methods inherited from class org.carrot2.core.LocalOutputComponentBase |
|---|
processingErrorOccurred, validate |
| Methods inherited from class org.carrot2.core.LocalComponentBase |
|---|
getDescription, getIntFromRequestContext, getName, getProperty, getRequiredSuccessorCapabilities, init, setProperty, toSet, toSet, toSet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.carrot2.core.LocalComponent |
|---|
getDescription, getName, getRequiredSuccessorCapabilities, init, processingErrorOccurred, setProperty |
| Constructor Detail |
|---|
public ArrayOutputComponent()
| Method Detail |
|---|
public Object getResult()
getResult in interface LocalOutputComponentArrayOutputComponent.Result with documents and
clusters collected during the query execution.
public void startProcessing(RequestContext requestContext)
throws ProcessingException
startProcessing in interface LocalComponentstartProcessing in class LocalOutputComponentBaserequestContext - A RequestContextinterface instance passed
by the container processing the query. The context may be used
to retrieve parameters associated with the query (see RequestContext.getRequestParameters() method).
ProcessingException - Thrown if the component encountered a problem
in processing the query. May also be thrown from a chained
successor component.
public void endProcessing()
throws ProcessingException
endProcessing in interface LocalComponentendProcessing in class LocalOutputComponentBaseProcessingException - Thrown if the component encountered a problem
in processing the query. May also be thrown from a chained
successor component. It is allowed to throw an exception and
not invoke endProcessing() method on
subsequent components. In such case, all components will
receive a LocalComponent.processingErrorOccurred()call.
public void addCluster(RawCluster cluster)
throws ProcessingException
addCluster in interface RawClustersConsumercluster - A new RawCluster passed from the predecessor
component.
ProcessingException - Thrown if this component cannot accept the
cluster reference for some reason.
public void addDocument(RawDocument doc)
throws ProcessingException
addDocument in interface RawDocumentsConsumerdoc - A new RawDocument object passed from the predecessor
component.
ProcessingException - Thrown if this component cannot accept the
document reference for some reason.public void flushResources()
flushResources in interface LocalComponentflushResources in class LocalOutputComponentBasepublic Set getComponentCapabilities()
LocalComponentBase
getComponentCapabilities in interface LocalComponentgetComponentCapabilities in class LocalComponentBaseSetobject with capabilities. The object
returned may be empty, but should never be null.LocalComponent.getComponentCapabilities()public Set getRequiredPredecessorCapabilities()
LocalComponentBase
getRequiredPredecessorCapabilities in interface LocalComponentgetRequiredPredecessorCapabilities in class LocalComponentBaseSetobject with capabilities. The object
returned may be empty, but should never be null.LocalComponent.getRequiredPredecessorCapabilities()
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||