Class TorrentFilter

java.lang.Object
com.biglybt.ui.console.commands.TorrentFilter

public class TorrentFilter extends Object
  • Field Details

    • rangePattern

      private static final Pattern rangePattern
  • Constructor Details

    • TorrentFilter

      public TorrentFilter()
  • Method Details

    • matchRange

      private List matchRange(List torrents, String filter)
      matches a range of torrents. eg: 3-5 or a single torrent. eg: 3. or from 3 onwards: 3-
      Parameters:
      torrents - torrents to match
      filter - range expression
      Returns:
      list of matched DownloadManager objects
    • matchWildcard

      private List matchWildcard(List torrents, String filter)
      attempst to match a wildcard against the list of torrents by checking their display name
      Parameters:
      torrents - list of available torrents to match
      filter - wildcard (glob) filter
      Returns:
      list of matched DownloadManager objects
    • wildcardToPattern

      private String wildcardToPattern(String wild)
      converts the wildcard (eg: tran*) into a regular expression - (tran.*)
      Parameters:
      wild - wildcard (glob) expression
      Returns:
      regular expression string
    • getTorrents

      public List getTorrents(List torrentsToMatch, String filter)
      tries our two different matching algorithms using the supplied filter against the list of torrents in the ConsoleInput object
      Parameters:
      torrentsToMatch - list of DownloadManager objects to attempt to match against
      filter - filter - eg: range or glob filter
      Returns:
      list of matched DownloadManager objects
    • getTorrents

      public List getTorrents(List torrentsToMatch, List args)
      first tries to match torrents by concatenating all of the arguments. if that doesn't work, attempts to match each argument individually.
      Parameters:
      torrentsToMatch - list of DownloadManager objects to attempt to match against
      args - arguments to try to match
      Returns:
      list of matched DownloadManager objects