19 package org.sleuthkit.autopsy.timeline.ui.detailview.datamodel;
21 import com.google.common.base.Preconditions;
22 import com.google.common.collect.Sets;
23 import static java.util.Collections.singleton;
24 import static java.util.Comparator.comparing;
25 import java.util.Objects;
26 import java.util.Optional;
28 import java.util.SortedSet;
40 private final SortedSet<EventCluster>
clusters;
45 private final TimelineEventType
type;
55 private final TimelineLevelOfDetail
lod;
74 Preconditions.checkNotNull(stripeA);
75 Preconditions.checkNotNull(stripeB);
77 Preconditions.checkArgument(Objects.equals(stripeA.
lod, stripeB.
lod));
78 Preconditions.checkArgument(Objects.equals(stripeA.
type, stripeB.
type));
79 Preconditions.checkArgument(Objects.equals(stripeA.
parent, stripeB.
parent));
84 if (Objects.nonNull(
this.parent)) {
85 throw new IllegalStateException(
"Event Stripe already has a parent!");
87 return new EventStripe(parent, this.type, this.description, this.lod, clusters, eventIDs, tagged, hashHits);
91 TimelineLevelOfDetail lod, SortedSet<EventCluster> clusters,
92 Set<Long> eventIDs, Set<Long> tagged, Set<Long> hashHits) {
131 return Optional.ofNullable(parent);
139 return Optional.empty();
175 return clusters.first().getStartMillis();
180 return clusters.last().getEndMillis();
190 return "EventStripe{" +
"description=" + description +
", eventIDs=" + (Objects.isNull(eventIDs) ? 0 : eventIDs.size()) +
'}';
196 hash = 79 * hash + Objects.hashCode(this.clusters);
197 hash = 79 * hash + Objects.hashCode(this.type);
198 hash = 79 * hash + Objects.hashCode(this.description);
199 hash = 79 * hash + Objects.hashCode(this.lod);
200 hash = 79 * hash + Objects.hashCode(this.eventIDs);
212 if (getClass() != obj.getClass()) {
216 if (!Objects.equals(
this.description, other.
description)) {
219 if (!Objects.equals(
this.clusters, other.
clusters)) {
222 if (!Objects.equals(
this.type, other.
type)) {
225 if (this.lod != other.
lod) {
EventStripe(EventCluster cluster)
Optional< EventCluster > getParent()
final Set< Long > hashHits
TimelineLevelOfDetail getDescriptionLevel()
boolean equals(Object obj)
Set< Long > getEventIDs()
Set< Long > getEventIDsWithHashHits()
EventStripe withParent(EventCluster parent)
Set< Long > getEventIDsWithTags()
final Set< Long > eventIDs
EventCluster withParent(EventStripe parent)
static EventStripe merge(EventStripe stripeA, EventStripe stripeB)
final TimelineEventType type
final EventCluster parent
EventStripe(EventCluster parent, TimelineEventType type, String description, TimelineLevelOfDetail lod, SortedSet< EventCluster > clusters, Set< Long > eventIDs, Set< Long > tagged, Set< Long > hashHits)
TimelineLevelOfDetail getDescriptionLevel()
Set< Long > getEventIDsWithTags()
Set< Long > getEventIDsWithHashHits()
final TimelineLevelOfDetail lod
EventStripe(EventStripe stripeA, EventStripe stripeB)
Set< Long > getEventIDs()
TimelineEventType getEventType()
final SortedSet< EventCluster > clusters
TimelineEventType getEventType()
Optional< EventStripe > getParentStripe()
SortedSet< EventCluster > getClusters()