19 package org.sleuthkit.autopsy.timeline.ui.detailview.tree;
21 import java.util.Comparator;
22 import javafx.scene.control.TreeItem;
23 import org.openide.util.NbBundle;
29 @NbBundle.Messages({
"TreeComparator.Description.displayName=Description",
30 "TreeComparator.Count.displayName=Count",
31 "TreeComparator.Type.displayName=Type"})
32 enum TreeComparator implements Comparator<TreeItem<DetailViewEvent>> {
34 Description(Bundle.TreeComparator_Description_displayName()) {
36 public int compare(TreeItem<DetailViewEvent> item1, TreeItem<DetailViewEvent> item2) {
37 return item1.getValue().
getDescription().compareTo(item2.getValue().getDescription());
40 Count(Bundle.TreeComparator_Count_displayName()) {
42 public int compare(TreeItem<DetailViewEvent> item1, TreeItem<DetailViewEvent> item2) {
43 return Long.compare(item2.getValue().getSize(), item1.getValue().getSize());
46 Type(Bundle.TreeComparator_Type_displayName()) {
48 public int compare(TreeItem<DetailViewEvent> item1, TreeItem<DetailViewEvent> item2) {
49 return item1.getValue().getEventType().compareTo(item2.getValue().getEventType());
53 private final String displayName;
55 private TreeComparator(String displayName) {
56 this.displayName = displayName;
59 public String getDisplayName() {