Class SummarizerSplitMoreThan<T>
- Type Parameters:
T
- type of element to be summarized
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a element to the summary.describe()
A string summarizing this item.int
If there are more thancountThreshold
elements, usesummarizerGreaterThan
, elsesummarizerElse
.Used for summary ifcount(elements) <= countThreshold
Used for summary ifcount(elements) > countThreshold
boolean
Whether aImageMetadataInput
is required as an input.void
setCountThreshold
(int countThreshold) If there are more thancountThreshold
elements, usesummarizerGreaterThan
, elsesummarizerElse
.void
setSummarizerElse
(Summarizer<T> summarizerElse) Used for summary ifcount(elements) <= countThreshold
void
setSummarizerGreaterThan
(Summarizer<T> summarizerGreaterThan) Used for summary ifcount(elements) > countThreshold
Methods inherited from class org.anchoranalysis.plugin.io.bean.summarizer.Summarizer
addAll
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
SummarizerSplitMoreThan
public SummarizerSplitMoreThan()
-
-
Method Details
-
add
Description copied from class:Summarizer
Adds a element to the summary.- Specified by:
add
in classSummarizer<T>
- Parameters:
element
- the element to add.- Throws:
OperationFailedException
-
describe
Description copied from class:Summarizer
A string summarizing this item.- Specified by:
describe
in classSummarizer<T>
- Returns:
- the description.
- Throws:
OperationFailedException
-
requiresImageMetadata
Description copied from class:Summarizer
Whether aImageMetadataInput
is required as an input.- Specified by:
requiresImageMetadata
in classSummarizer<T>
- Returns:
- true if the summarize requires
ImageMetadataInput
as input, or false if any input is acceptable. - Throws:
OperationFailedException
- if this cannot be established.
-
getCountThreshold
public int getCountThreshold()If there are more thancountThreshold
elements, usesummarizerGreaterThan
, elsesummarizerElse
. -
setCountThreshold
public void setCountThreshold(int countThreshold) If there are more thancountThreshold
elements, 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
-