Class AbstractSplitter

    • Constructor Detail

      • AbstractSplitter

        public AbstractSplitter()
    • Method Detail

      • check

        protected <T> String check​(List<Binnable<T>> data)
        Check method before performing randomization.
        Parameters:
        data - the data to check
        Returns:
        null if checks passed, otherwise error message
      • getMinimumSize

        protected int getMinimumSize()
        Returns the minimum number of items required for splitting.
        Returns:
        the minimum
      • doSplit

        protected abstract <T> com.github.fracpete.javautils.struct.Struct2<List<Binnable<T>>,​List<Binnable<T>>> doSplit​(List<Binnable<T>> data)
        Splits the data into two.
        Type Parameters:
        T - the payload type
        Parameters:
        data - the data to split
        Returns:
        the split data
      • split

        public <T> com.github.fracpete.javautils.struct.Struct2<List<Binnable<T>>,​List<Binnable<T>>> split​(List<Binnable<T>> data)
        Splits the data into two.
        Specified by:
        split in interface Splitter
        Type Parameters:
        T - the payload type
        Parameters:
        data - the data to split
        Returns:
        the split data