Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ZoomParams.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.timeline.zooming;
20 
21 import java.util.Objects;
22 import org.joda.time.Interval;
24 
29 public class ZoomParams {
30 
31  private final Interval timeRange;
32 
34 
35  private final RootFilter filter;
36 
37  private final DescriptionLoD descrLOD;
38 
39  public Interval getTimeRange() {
40  return timeRange;
41  }
42 
44  return typeZoomLevel;
45  }
46 
47  public RootFilter getFilter() {
48  return filter;
49  }
50 
52  return descrLOD;
53  }
54 
55  public ZoomParams(Interval timeRange, EventTypeZoomLevel zoomLevel, RootFilter filter, DescriptionLoD descrLOD) {
56  this.timeRange = timeRange;
57  this.typeZoomLevel = zoomLevel;
58  this.filter = filter;
59  this.descrLOD = descrLOD;
60  }
61 
62  public ZoomParams withTimeAndType(Interval timeRange, EventTypeZoomLevel zoomLevel) {
63  return new ZoomParams(timeRange, zoomLevel, filter, descrLOD);
64  }
65 
67  return new ZoomParams(timeRange, zoomLevel, filter, descrLOD);
68  }
69 
70  public ZoomParams withTimeRange(Interval timeRange) {
71  return new ZoomParams(timeRange, typeZoomLevel, filter, descrLOD);
72  }
73 
75  return new ZoomParams(timeRange, typeZoomLevel, filter, descrLOD);
76  }
77 
78  public ZoomParams withFilter(RootFilter filter) {
79  return new ZoomParams(timeRange, typeZoomLevel, filter, descrLOD);
80  }
81 
82  public boolean hasFilter(RootFilter filterSet) {
83  return this.filter.equals(filterSet);
84  }
85 
86  public boolean hasTypeZoomLevel(EventTypeZoomLevel typeZoom) {
87  return this.typeZoomLevel.equals(typeZoom);
88  }
89 
90  public boolean hasTimeRange(Interval timeRange) {
91  return this.timeRange == null ? false : this.timeRange.equals(timeRange);
92  }
93 
94  public boolean hasDescrLOD(DescriptionLoD newLOD) {
95  return this.descrLOD.equals(newLOD);
96  }
97 
98  @Override
99  public int hashCode() {
100  int hash = 3;
101  hash = 97 * hash + Objects.hashCode(this.timeRange.getStartMillis());
102  hash = 97 * hash + Objects.hashCode(this.timeRange.getEndMillis());
103  hash = 97 * hash + Objects.hashCode(this.typeZoomLevel);
104  hash = 97 * hash + Objects.hashCode(this.filter.isSelected());
105  hash = 97 * hash + Objects.hashCode(this.descrLOD);
106 
107  return hash;
108  }
109 
110  @Override
111  public boolean equals(Object obj) {
112  if (obj == null) {
113  return false;
114  }
115  if (getClass() != obj.getClass()) {
116  return false;
117  }
118  final ZoomParams other = (ZoomParams) obj;
119  if (!Objects.equals(this.timeRange, other.timeRange)) {
120  return false;
121  }
122  if (this.typeZoomLevel != other.typeZoomLevel) {
123  return false;
124  }
125  if (this.filter.equals(other.filter) == false) {
126  return false;
127  }
128  return this.descrLOD == other.descrLOD;
129  }
130 
131  @Override
132  public String toString() {
133  return "ZoomParams{" + "timeRange=" + timeRange + ", typeZoomLevel=" + typeZoomLevel + ", filter=" + filter + ", descrLOD=" + descrLOD + '}'; //NON-NLS
134  }
135 
136 }
ZoomParams withDescrLOD(DescriptionLoD descrLOD)
Definition: ZoomParams.java:74
ZoomParams withTypeZoomLevel(EventTypeZoomLevel zoomLevel)
Definition: ZoomParams.java:66
boolean hasTypeZoomLevel(EventTypeZoomLevel typeZoom)
Definition: ZoomParams.java:86
boolean hasDescrLOD(DescriptionLoD newLOD)
Definition: ZoomParams.java:94
ZoomParams withTimeRange(Interval timeRange)
Definition: ZoomParams.java:70
ZoomParams(Interval timeRange, EventTypeZoomLevel zoomLevel, RootFilter filter, DescriptionLoD descrLOD)
Definition: ZoomParams.java:55
ZoomParams withTimeAndType(Interval timeRange, EventTypeZoomLevel zoomLevel)
Definition: ZoomParams.java:62
ZoomParams withFilter(RootFilter filter)
Definition: ZoomParams.java:78

Copyright © 2012-2016 Basis Technology. Generated on: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.