This commit is contained in:
jmillman 2016-04-15 13:47:02 -04:00
parent a664079b54
commit ef98498d82
3 changed files with 32 additions and 0 deletions

View File

@ -127,13 +127,26 @@ public class EventCluster implements MultiEvent<EventStripe> {
this(spanningInterval, type, eventIDs, hashHits, tagged, description, lod, null);
}
/**
* get the EventStripe (if any) that contains this cluster
*
* @return an Optional containg the parent stripe of this cluster, or is
* empty if the cluster has no parent set.
*/
@Override
public Optional<EventStripe> getParent() {
return Optional.ofNullable(parent);
}
/**
* get the EventStripe (if any) that contains this cluster
*
* @return an Optional containg the parent stripe of this cluster, or is
* empty if the cluster has no parent set.
*/
@Override
public Optional<EventStripe> getParentStripe() {
//since this clusters parent must be an event stripe just delegate to getParent();
return getParent();
}

View File

@ -51,6 +51,11 @@ public class SingleEvent implements TimeLineEvent {
private final boolean hashHit;
private final boolean tagged;
/**
* Single events may or may not have their parent set, since that is a
* transient property of the current (details ) view. The parent may be any
* kind of MultiEvent.
*/
private MultiEvent<?> parent = null;
public SingleEvent(long eventID, long dataSourceID, long objID, @Nullable Long artifactID, long time, EventType type, String fullDescription, String medDescription, String shortDescription, TskData.FileKnown known, boolean hashHit, boolean tagged) {
@ -195,6 +200,14 @@ public class SingleEvent implements TimeLineEvent {
return DescriptionLoD.FULL;
}
/**
* get the EventStripe (if any) that contains this event, skipping over any
* intervening event cluster
*
* @return an Optional containing the parent stripe of this cluster. is
* empty if the cluster has no parent set or the parent has no
* parent stripe.
*/
@Override
public Optional<EventStripe> getParentStripe() {
if (parent == null) {

View File

@ -33,6 +33,12 @@ public interface TimeLineEvent {
public DescriptionLoD getDescriptionLoD();
/**
* get the EventStripe (if any) that contains this event
*
* @return an Optional containing the parent stripe of this event, or is
* empty if the event has no parent stripe.
*/
public Optional<EventStripe> getParentStripe();
Set<Long> getEventIDs();