Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
org.sleuthkit.autopsy.discovery.search.ResultsSorter Class Reference

Inherits Comparator< Result >.

Classes

enum  SortingMethod
 

Public Member Functions

 ResultsSorter (SortingMethod method)
 
int compare (Result result1, Result result2)
 

Static Private Member Functions

static int compareStrings (String s1, String s2)
 
static Comparator< ResultgetDataSourceComparator ()
 
static Comparator< ResultgetDefaultComparator ()
 
static Comparator< ResultgetDomainNameComparator ()
 
static Comparator< ResultgetFileNameComparator ()
 
static Comparator< ResultgetFileSizeComparator ()
 
static Comparator< ResultgetFrequencyComparator ()
 
static Comparator< ResultgetKeywordListNameComparator ()
 
static Comparator< ResultgetLastActivityDateTimeComparator ()
 
static Comparator< ResultgetMIMETypeComparator ()
 
static Comparator< ResultgetPageViewComparator ()
 
static Comparator< ResultgetParentPathComparator ()
 
static Comparator< ResultgetTypeComparator ()
 
static Comparator< ResultgetWebDownloadsComparator ()
 

Private Attributes

final List< Comparator< Result > > comparators = new ArrayList<>()
 

Detailed Description

Class used to sort Results using the supplied method.

Definition at line 32 of file ResultsSorter.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter ( SortingMethod  method)

Member Function Documentation

int org.sleuthkit.autopsy.discovery.search.ResultsSorter.compare ( Result  result1,
Result  result2 
)
static int org.sleuthkit.autopsy.discovery.search.ResultsSorter.compareStrings ( String  s1,
String  s2 
)
staticprivate
static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getDataSourceComparator ( )
staticprivate

Compare results using data source ID. Will order smallest to largest.

Returns
-1 if result1 has the lower data source ID, 0 if equal, 1 otherwise.

Definition at line 112 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.Result.getDataSourceObjectId().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getDefaultComparator ( )
staticprivate

A final default comparison between two ResultFile objects. Currently this is on file name and then object ID. It can be changed but should always include something like the object ID to ensure a consistent sorting when the rest of the compared fields are the same.

Returns
-1 if file1 comes before file2, 0 if equal, 1 otherwise.

Definition at line 328 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.SearchData.Type.DOMAIN, org.sleuthkit.autopsy.discovery.search.ResultsSorter.getFileNameComparator(), org.sleuthkit.autopsy.discovery.search.ResultFile.getFirstInstance(), org.sleuthkit.autopsy.discovery.search.ResultsSorter.getFrequencyComparator(), and org.sleuthkit.autopsy.discovery.search.Result.getType().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getDomainNameComparator ( )
staticprivate
static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getFileNameComparator ( )
staticprivate
static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getFileSizeComparator ( )
staticprivate

Compare files based on size. Order large to small.

Returns
-1 if result1 is larger than result2, 0 if equal, 1 otherwise.

Definition at line 221 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.SearchData.Type.DOMAIN, and org.sleuthkit.autopsy.discovery.search.Result.getType().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getFrequencyComparator ( )
staticprivate

Compare results based on number of occurrences in the central repository. Order from most rare to least rare Frequency enum.

Returns
-1 if result1's rarity is lower than result2, 0 if equal, 1 otherwise.

Definition at line 197 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.Result.getFrequency().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.getDefaultComparator(), and org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getKeywordListNameComparator ( )
staticprivate

Compare files using a concatenated version of keyword list names. Alphabetical by the list names with files with no keyword list hits going last.

Returns
-1 if result1 has the earliest combined keyword list name, 0 if equal, 1 otherwise.

Definition at line 134 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.ResultsSorter.compareStrings(), org.sleuthkit.autopsy.discovery.search.SearchData.Type.DOMAIN, org.sleuthkit.autopsy.discovery.search.ResultFile.getKeywordListNames(), and org.sleuthkit.autopsy.discovery.search.Result.getType().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getLastActivityDateTimeComparator ( )
staticprivate
static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getMIMETypeComparator ( )
staticprivate

Compare files based on MIME type. Order is alphabetical.

Returns
-1 if result1's MIME type comes before result2's, 0 if equal, 1 otherwise.

Definition at line 207 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.ResultsSorter.compareStrings(), org.sleuthkit.autopsy.discovery.search.SearchData.Type.DOMAIN, and org.sleuthkit.autopsy.discovery.search.Result.getType().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getPageViewComparator ( )
staticprivate
static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getParentPathComparator ( )
staticprivate
static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getTypeComparator ( )
staticprivate

Compare results using their Type enum. Orders based on the ranking in the Type enum.

Returns
-1 if result1 has the lower Type value, 0 if equal, 1 otherwise.

Definition at line 122 of file ResultsSorter.java.

References org.sleuthkit.autopsy.discovery.search.Result.getType().

Referenced by org.sleuthkit.autopsy.discovery.search.ResultsSorter.ResultsSorter().

static Comparator<Result> org.sleuthkit.autopsy.discovery.search.ResultsSorter.getWebDownloadsComparator ( )
staticprivate

Member Data Documentation

final List<Comparator<Result> > org.sleuthkit.autopsy.discovery.search.ResultsSorter.comparators = new ArrayList<>()
private

Definition at line 34 of file ResultsSorter.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2021 Basis Technology. Generated on: Thu Jul 8 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.