Class SummarizerSplitMoreThan<T>
Object
org.anchoranalysis.bean.AnchorBean<Summarizer<T>>
org.anchoranalysis.plugin.io.bean.summarizer.Summarizer<T>
org.anchoranalysis.plugin.io.bean.summarizer.SummarizerSplitMoreThan<T>
- Type Parameters:
T- type of element to be summarized
public class SummarizerSplitMoreThan<T> extends Summarizer<T>
Multiplexes between two summarizers depending on the total number of count.
If the count is greater than a threshold, one summarizer is used, if not another.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description SummarizerSplitMoreThan() -
Method Summary
Modifier and Type Method Description voidadd(T element)Adds a element to the summary.Stringdescribe()A string summarizing this item.intgetCountThreshold()If there are more thancountThresholdelements, usesummarizerGreaterThan, elsesummarizerElse.Summarizer<T>getSummarizerElse()Used for summary ifcount(elements) <= countThresholdSummarizer<T>getSummarizerGreaterThan()Used for summary ifcount(elements) > countThresholdbooleanrequiresImageMetadata()Whether aImageMetadataInputis required as an input.voidsetCountThreshold(int countThreshold)If there are more thancountThresholdelements, usesummarizerGreaterThan, elsesummarizerElse.voidsetSummarizerElse(Summarizer<T> summarizerElse)Used for summary ifcount(elements) <= countThresholdvoidsetSummarizerGreaterThan(Summarizer<T> summarizerGreaterThan)Used for summary ifcount(elements) > countThreshold
-
Constructor Details
-
SummarizerSplitMoreThan
public SummarizerSplitMoreThan()
-
-
Method Details
-
add
Description copied from class:SummarizerAdds a element to the summary.- Specified by:
addin classSummarizer<T>- Parameters:
element- the element to add.- Throws:
org.anchoranalysis.core.exception.OperationFailedException
-
describe
Description copied from class:SummarizerA string summarizing this item.- Specified by:
describein classSummarizer<T>- Returns:
- the description.
- Throws:
org.anchoranalysis.core.exception.OperationFailedException
-
requiresImageMetadata
public boolean requiresImageMetadata() throws org.anchoranalysis.core.exception.OperationFailedExceptionDescription copied from class:SummarizerWhether aImageMetadataInputis required as an input.- Specified by:
requiresImageMetadatain classSummarizer<T>- Returns:
- true if the summarize requires
ImageMetadataInputas input, or false if any input is acceptable. - Throws:
org.anchoranalysis.core.exception.OperationFailedException- if this cannot be established.
-
getCountThreshold
public int getCountThreshold()If there are more thancountThresholdelements, usesummarizerGreaterThan, elsesummarizerElse. -
setCountThreshold
public void setCountThreshold(int countThreshold)If there are more thancountThresholdelements, usesummarizerGreaterThan, elsesummarizerElse. -
getSummarizerGreaterThan
Used for summary ifcount(elements) > countThreshold -
setSummarizerGreaterThan
Used for summary ifcount(elements) > countThreshold -
getSummarizerElse
Used for summary ifcount(elements) <= countThreshold -
setSummarizerElse
Used for summary ifcount(elements) <= countThreshold
-