Autopsy  4.17.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CommonAttributeValueList.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2018-2019 Basis Technology Corp.
6  * Contact: carrier <at> sleuthkit <dot> org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 package org.sleuthkit.autopsy.commonpropertiessearch;
21 
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.HashSet;
25 import java.util.List;
26 import java.util.Set;
27 
33 final public class CommonAttributeValueList {
34 
38  private final List<CommonAttributeValue> metadataList;
39 
44  private final List<CommonAttributeValue> delayedMetadataList;
45 
52  CommonAttributeValueList(List<CommonAttributeValue> metadata) {
53  this.metadataList = new ArrayList<>();
54  this.delayedMetadataList = metadata;
55  }
56 
58  this.metadataList = new ArrayList<>();
59  this.delayedMetadataList = new ArrayList<>();
60  }
61 
68  public List<CommonAttributeValue> getMetadataList() {
69  return Collections.unmodifiableList(this.metadataList);
70  }
71 
78  Set<CommonAttributeValue> getDelayedMetadataSet() {
79  //Allows nodes to be de-duped
80  return new HashSet<>(this.delayedMetadataList);
81  }
82 
83  void removeMetaData(CommonAttributeValue commonVal) {
84  this.delayedMetadataList.remove(commonVal);
85  }
86 
93  int getCommonAttributeListSize() {
94  return this.delayedMetadataList.size();
95  }
96 
102  public void displayDelayedMetadata() {
103  if (metadataList.isEmpty()) {
104  this.metadataList.addAll(this.delayedMetadataList);
105  }
106  }
107 
113  void addMetadataToList(CommonAttributeValue metadata) {
114  delayedMetadataList.add(metadata);
115  }
116 }

Copyright © 2012-2021 Basis Technology. Generated on: Tue Jan 19 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.