Package com.biglybt.ui.console.commands
Class TorrentFilter
java.lang.Object
com.biglybt.ui.console.commands.TorrentFilter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTorrents
(List torrentsToMatch, String filter) tries our two different matching algorithms using the supplied filter against the list of torrents in the ConsoleInput objectgetTorrents
(List torrentsToMatch, List args) first tries to match torrents by concatenating all of the arguments.private List
matchRange
(List torrents, String filter) matches a range of torrents.private List
matchWildcard
(List torrents, String filter) attempst to match a wildcard against the list of torrents by checking their display nameprivate String
wildcardToPattern
(String wild) converts the wildcard (eg: tran*) into a regular expression - (tran.*)
-
Field Details
-
rangePattern
-
-
Constructor Details
-
TorrentFilter
public TorrentFilter()
-
-
Method Details
-
matchRange
matches a range of torrents. eg: 3-5 or a single torrent. eg: 3. or from 3 onwards: 3-- Parameters:
torrents
- torrents to matchfilter
- range expression- Returns:
- list of matched DownloadManager objects
-
matchWildcard
attempst to match a wildcard against the list of torrents by checking their display name- Parameters:
torrents
- list of available torrents to matchfilter
- wildcard (glob) filter- Returns:
- list of matched DownloadManager objects
-
wildcardToPattern
converts the wildcard (eg: tran*) into a regular expression - (tran.*)- Parameters:
wild
- wildcard (glob) expression- Returns:
- regular expression string
-
getTorrents
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 againstfilter
- filter - eg: range or glob filter- Returns:
- list of matched DownloadManager objects
-
getTorrents
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 againstargs
- arguments to try to match- Returns:
- list of matched DownloadManager objects
-