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 Details

  • Method Details

    • add

      public void add​(T element) throws org.anchoranalysis.core.exception.OperationFailedException
      Description copied from class: Summarizer
      Adds a element to the summary.
      Specified by:
      add in class Summarizer<T>
      Parameters:
      element - the element to add.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException
    • describe

      public String describe() throws org.anchoranalysis.core.exception.OperationFailedException
      Description copied from class: Summarizer
      A string summarizing this item.
      Specified by:
      describe in class Summarizer<T>
      Returns:
      the description.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException
    • requiresImageMetadata

      public boolean requiresImageMetadata() throws org.anchoranalysis.core.exception.OperationFailedException
      Description copied from class: Summarizer
      Whether a ImageMetadataInput is required as an input.
      Specified by:
      requiresImageMetadata in class Summarizer<T>
      Returns:
      true if the summarize requires ImageMetadataInput as 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 than countThreshold elements, use summarizerGreaterThan, else summarizerElse.
    • setCountThreshold

      public void setCountThreshold​(int countThreshold)
      If there are more than countThreshold elements, use summarizerGreaterThan, else summarizerElse.
    • getSummarizerGreaterThan

      public Summarizer<T> getSummarizerGreaterThan()
      Used for summary if count(elements) > countThreshold
    • setSummarizerGreaterThan

      public void setSummarizerGreaterThan​(Summarizer<T> summarizerGreaterThan)
      Used for summary if count(elements) > countThreshold
    • getSummarizerElse

      public Summarizer<T> getSummarizerElse()
      Used for summary if count(elements) <= countThreshold
    • setSummarizerElse

      public void setSummarizerElse​(Summarizer<T> summarizerElse)
      Used for summary if count(elements) <= countThreshold