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.Collection;
25 import java.util.Comparator;
26 import java.util.Objects;
27 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");
60 Sets.SetView<Long> idsUnion =
62 Sets.SetView<Long> hashHitsUnion =
64 Sets.SetView<Long> taggedUnion =
68 cluster1.
getEventType(), idsUnion, hashHitsUnion, taggedUnion,
77 final private Interval
span;
112 Collection<Long> hashHits, Collection<Long> tagged, String description,
DescriptionLoD lod,
115 this.span = spanningInterval;
117 this.hashHits = ImmutableSet.copyOf(hashHits);
118 this.tagged = ImmutableSet.copyOf(tagged);
120 this.eventIDs = ImmutableSet.copyOf(eventIDs);
126 Collection<Long> hashHits, Collection<Long> tagged, String description,
DescriptionLoD lod) {
138 return Optional.ofNullable(parent);
159 return span.getStartMillis();
164 return span.getEndMillis();
207 return new EventCluster(span, type, eventIDs, hashHits, tagged, description, lod, parent);
217 return "EventCluster{" +
"description=" + description +
", eventIDs=" + eventIDs.size() +
'}';
223 hash = 23 * hash + Objects.hashCode(this.type);
224 hash = 23 * hash + Objects.hashCode(this.description);
225 hash = 23 * hash + Objects.hashCode(this.lod);
226 hash = 23 * hash + Objects.hashCode(this.eventIDs);
238 if (getClass() != obj.getClass()) {
242 if (!Objects.equals(
this.description, other.
description)) {
245 if (!Objects.equals(
this.type, other.
type)) {
248 if (this.lod != other.
lod) {
251 if (!Objects.equals(
this.eventIDs, other.
eventIDs)) {
static Interval span(Interval range, final Interval range2)
final ImmutableSet< Long > tagged
SortedSet< EventCluster > getClusters()
Optional< EventStripe > getParentStripe()
DescriptionLoD getDescriptionLoD()
EventCluster withParent(EventStripe parent)
final ImmutableSet< Long > hashHits
EventCluster(Interval spanningInterval, EventType type, Collection< Long > eventIDs, Collection< Long > hashHits, Collection< Long > tagged, String description, DescriptionLoD lod, EventStripe parent)
EventCluster(Interval spanningInterval, EventType type, Collection< Long > eventIDs, Collection< Long > hashHits, Collection< Long > tagged, String description, DescriptionLoD lod)
final ImmutableSet< Long > eventIDs
boolean equals(Object obj)
Optional< EventStripe > getParent()
static EventCluster merge(EventCluster cluster1, EventCluster cluster2)
ImmutableSet< Long > getEventIDsWithHashHits()
ImmutableSet< Long > getEventIDs()
ImmutableSet< Long > getEventIDsWithTags()