Class SplitPointHandler<T extends SplitPointUnit,​U extends SplitPointDataSource<T,​U>>

  • Type Parameters:
    T - the type of split point units
    U - the type of data source

    public class SplitPointHandler<T extends SplitPointUnit,​U extends SplitPointDataSource<T,​U>>
    extends Object
    Breaks units into results. All allowed break points are supplied with the input.
    • Constructor Detail

      • SplitPointHandler

        public SplitPointHandler()
    • Method Detail

      • split

        @SafeVarargs
        public static <T extends SplitPointUnitSplitPoint<T,​SplitPointDataList<T>> split​(float breakPoint,
                                                                                                 T... units)
        Splits the data at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Type Parameters:
        T - the type of split point units
        Parameters:
        breakPoint - the split point
        units - the data
        Returns:
        returns a split point result
      • split

        public static <T extends SplitPointUnitSplitPoint<T,​SplitPointDataList<T>> split​(float breakPoint,
                                                                                                 List<T> units,
                                                                                                 SplitOption... options)
        Splits the data at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Type Parameters:
        T - the type of split point units
        Parameters:
        breakPoint - the split point
        units - the data
        options - the split options
        Returns:
        returns a split point result
      • split

        public static <T extends SplitPointUnitSplitPoint<T,​SplitPointDataList<T>> split​(float breakPoint,
                                                                                                 List<T> units,
                                                                                                 SplitPointCost<T> cost,
                                                                                                 SplitOption... options)
        Splits the data at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Type Parameters:
        T - the type of split point units
        Parameters:
        breakPoint - the split point
        units - the data
        cost - the cost function used when determining the optimal forced split point. In other words, the cost function is only used if there are no breakable units available.
        options - the split options
        Returns:
        returns a split point result
      • split

        public SplitPoint<T,​U> split​(float breakPoint,
                                           U data,
                                           SplitOption... options)
        Splits the data at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Parameters:
        breakPoint - the split point
        data - the data to split
        options - the split options
        Returns:
        returns a split point result
      • split

        public SplitPoint<T,​U> split​(float breakPoint,
                                           U data,
                                           SplitPointCost<T> cost,
                                           SplitOption... options)
        Splits the data at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Parameters:
        breakPoint - the split point
        data - the data to split
        cost - the cost function used when determining the optimal forced split point. In other words, the cost function is only used if there are no breakable units available.
        options - the split options
        Returns:
        returns a split point result
        Throws:
        IllegalArgumentException - if cost is null
      • find

        public SplitPointSpecification find​(float breakPoint,
                                            U data,
                                            SplitOption... options)
        Finds a split point at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Parameters:
        breakPoint - the split point
        data - the data to split
        options - the split options
        Returns:
        returns a split point specification
      • find

        public SplitPointSpecification find​(float breakPoint,
                                            U data,
                                            SplitPointCost<T> cost,
                                            SplitOption... options)
        Finds a split point at, or before, the supplied breakPoint according to the rules in the data. If force is used, rules may be broken to achieve a result.
        Parameters:
        breakPoint - the split point
        data - the data to split
        cost - the cost function used when determining the optimal forced split point. In other words, the cost function is only used if there are no breakable units available.
        options - the split options
        Returns:
        returns a split point specification