-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'#1864 Initial implementations of modifications to support Time event
grouping on Timeline tab.
- Loading branch information
1 parent
6e484b6
commit daae03c
Showing
11 changed files
with
350 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
iped-app/src/main/java/iped/app/timelinegraph/TimeEventGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package iped.app.timelinegraph; | ||
|
||
import java.util.HashSet; | ||
|
||
/** | ||
* Class that represents a collection of event to use as a filter to graph | ||
* events viewing. Also, the cache will be managed/persisted based on this event | ||
* groups | ||
* | ||
* @author Patrick Dalla Bernardina [email protected] | ||
*/ | ||
public class TimeEventGroup { | ||
public static final TimeEventGroup ALL_EVENTS = new TimeEventGroup(); | ||
public static final TimeEventGroup BASIC_EVENTS = new TimeEventGroup("BasicProperties"); | ||
|
||
HashSet eventNames = new HashSet<String>(); | ||
|
||
String name; | ||
|
||
private TimeEventGroup() { | ||
this.name = "ALL"; | ||
} | ||
|
||
public TimeEventGroup(String name) { | ||
this.name = name; | ||
} | ||
|
||
public boolean hasEvent(String eventType) { | ||
if (this == ALL_EVENTS) { | ||
return true; | ||
} | ||
return eventNames.contains(eventType); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return name.hashCode(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj instanceof TimeEventGroup) { | ||
return name.equals(((TimeEventGroup) obj).name); | ||
} else { | ||
return true; | ||
} | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void addEvent(String eventName) { | ||
eventNames.add(eventName); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.