19 package org.sleuthkit.autopsy.timeline.datamodel;
21 import com.google.common.collect.ImmutableSet;
22 import com.google.common.collect.ImmutableSortedSet;
23 import com.google.common.collect.Sets;
24 import java.util.Comparator;
25 import java.util.Objects;
26 import java.util.Optional;
28 import java.util.SortedSet;
29 import javax.annotation.concurrent.Immutable;
30 import org.joda.time.Interval;
54 throw new IllegalArgumentException(
"event clusters are not compatible: they have different types");
58 throw new IllegalArgumentException(
"event clusters are not compatible: they have different descriptions");
72 final private Interval
span;
98 private final ImmutableSet<Long>
tagged;
108 this.span = spanningInterval;
110 this.hashHits = ImmutableSet.copyOf(hashHits);
111 this.tagged = ImmutableSet.copyOf(tagged);
113 this.eventIDs = ImmutableSet.copyOf(eventIDs);
124 return Optional.ofNullable(parent);
133 return span.getStartMillis();
138 return span.getEndMillis();
142 @SuppressWarnings(
"ReturnOfCollectionOrArrayField")
148 @SuppressWarnings(
"ReturnOfCollectionOrArrayField")
154 @SuppressWarnings(
"ReturnOfCollectionOrArrayField")
184 if (Objects.nonNull(
this.parent)) {
185 throw new IllegalStateException(
"Event Cluster already has a parent!");
187 return new EventCluster(span, type, eventIDs, hashHits, tagged, description, lod, parent);
static Interval span(Interval range, final Interval range2)
final ImmutableSet< Long > tagged
EventCluster(Interval spanningInterval, EventType type, Set< Long > eventIDs, Set< Long > hashHits, Set< Long > tagged, String description, DescriptionLoD lod, EventStripe parent)
DescriptionLoD getDescriptionLoD()
EventCluster withParent(EventStripe parent)
final ImmutableSet< Long > hashHits
final ImmutableSet< Long > eventIDs
static EventCluster merge(EventCluster cluster1, EventCluster cluster2)
Optional< EventStripe > getParentBundle()
EventCluster(Interval spanningInterval, EventType type, Set< Long > eventIDs, Set< Long > hashHits, Set< Long > tagged, String description, DescriptionLoD lod)
ImmutableSet< Long > getEventIDsWithHashHits()
SortedSet< EventCluster > getClusters()
ImmutableSet< Long > getEventIDs()
ImmutableSet< Long > getEventIDsWithTags()