Class Window

java.lang.Object
io.openml.gearbox.interval.Window

public class Window extends Object
Algorithms on problems that involves concepts of "window".
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E> List<E>
    minWindow(List<E> source, List<E> target)
    Given 2 lists of elements called "source list" and "target list", this method returns the minimum window in source list that contains all of the elements from the target list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Window

      public Window()
  • Method Details

    • minWindow

      public static <E> List<E> minWindow(List<E> source, List<E> target)
      Given 2 lists of elements called "source list" and "target list", this method returns the minimum window in source list that contains all of the elements from the target list.

      For example, if the elements are all characters:

      • source list = ['A', 'D', 'O', 'B', 'E', 'C', 'O', 'D', 'E', 'B', 'A', 'N', 'C']
      • target list = ['A', 'B', 'C']
      Then the minimum window is "BANC", which is returned as ['B', 'A', 'N', 'C'].

      If there is no such window in source that covers all elements in target, the method returns an empty list

      Type Parameters:
      E - The type of elements in two lists
      Parameters:
      source - The source list
      target - The target list
      Returns:
      a sub-consecutive portion of the source list that includes all elements of the target list
      Throws:
      NullPointerException - if either list is null