/**
*
*/
package at.gv.egiz.pdfas.impl.api.analyze;
import java.util.List;
import at.gv.egiz.pdfas.api.analyze.AnalyzeParameters;
import at.gv.egiz.pdfas.api.analyze.AnalyzeResult;
import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
/**
* Holds the result of an analyzation.
*
* @author wprinz
*/
public class AnalyzeResultImpl implements AnalyzeResult
{
/**
* The found signatures.
*/
protected List signatures = null;
/**
* The found non-signature update blocks.
*/
protected List noSignatures = null;
protected List nonTextualObjects = null;
/**
* Constructor.
*
* @param signatures
* The found signatures.
* @param noSignatures
* The found non-signature update blocks.
*/
public AnalyzeResultImpl(List signatures, List noSignatures)
{
this(signatures, noSignatures, null);
}
/**
* Constructor.
*
* @param signatures
* The found signatures.
* @param noSignatures
* The found non-signature update blocks.
* @param nonTextInfos Non textual data from pdf provided that {@link AnalyzeParameters#setReturnNonTextualObjects(boolean)} was set.
*/
public AnalyzeResultImpl(List signatures, List noSignatures, List nonTextInfos)
{
if (signatures == null)
{
throw new IllegalArgumentException("The list of found signatures must not be null.");
}
this.signatures = signatures;
this.noSignatures = noSignatures;
this.nonTextualObjects = nonTextInfos;
}
/**
* Constructor.
*
* @param signatures
* The found signatures.
*/
public AnalyzeResultImpl(List signatures)
{
if (signatures == null)
{
throw new IllegalArgumentException("The list of found signatures must not be null.");
}
this.signatures = signatures;
}
/**
* @see at.gv.egiz.pdfas.api.analyze.AnalyzeResult#getSignatures()
*/
public List getSignatures() throws PdfAsException
{
return this.signatures;
}
public List getNoSignatures() {
return this.noSignatures;
}
/**
* Returns non textual data from pdf provided that {@link AnalyzeParameters#setReturnNonTextualObjects(boolean)}
* has been set {@code true}.
* @return List of {@link NonTextObjectInfo}
*/
public List getNonTextualObjects() {
return this.nonTextualObjects;
}
/**
* Returns true
if non textual objects have been found, false
if not.
* @return true
if non textual objects have been found, false
if not.
*/
public boolean hasNonTextualObjects() {
return this.nonTextualObjects != null && !this.nonTextualObjects.isEmpty();
}
}