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;
27 @NbBundle.Messages({
"TreeComparator.Description.displayName=Description",
28 "TreeComparator.Count.displayName=Count",
29 "TreeComparator.Type.displayName=Type"})
30 enum TreeComparator implements Comparator<TreeItem<TimeLineEvent>> {
32 Description(Bundle.TreeComparator_Description_displayName()) {
34 public int compare(TreeItem<TimeLineEvent> o1, TreeItem<TimeLineEvent> o2) {
35 return o1.getValue().getDescription().compareTo(o2.getValue().getDescription());
38 Count(Bundle.TreeComparator_Count_displayName()) {
40 public int compare(TreeItem<TimeLineEvent> o1, TreeItem<TimeLineEvent> o2) {
41 return Long.compare(o2.getValue().getSize(), o1.getValue().getSize());
44 Type(Bundle.TreeComparator_Type_displayName()) {
46 public int compare(TreeItem<TimeLineEvent> o1, TreeItem<TimeLineEvent> o2) {
47 return EventType.
getComparator().compare(o1.getValue().getEventType(), o2.getValue().getEventType());
51 private final String displayName;
53 private TreeComparator(String displayName) {
54 this.displayName = displayName;
57 public String getDisplayName() {
static Comparator< EventType > getComparator()