blob: 914938544e74dc4fc438a3408d1f255137af9b8d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/*******************************************************************************
* Copyright (c) 2007, 2010 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Intel Corporation - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.enablement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Set;
public class AdjustmentContext {
// static final int TYPE_CONFIGURATION = 1;
// static final int TYPE_TOOL_CHAIN = 2;
// static final int TYPE_TOOL = 3;
// static final int TYPE_OPTION = 4;
// static final int TYPE_OUTPUT_TYPE = 5;
// private IBuildObject fObject;
// private int fType;
// class AfjustedInfo{
// private boolean fAdjusted;
//
// void addAdjustmentState(boolean adjusted){
// if(!fAdjusted && adjusted){
// fAdjusted = adjusted;
// }
// }
//
// boolean isAdjusted(){
// return fAdjusted;
// }
// }
// AdjustmentInfo(IConfiguration cfg){
// fObject = cfg;
// fType = TYPE_CONFIGURATION;
// }
// public int getType(){
// return fType;
// }
private HashMap<String, Boolean> fMap = new HashMap<String, Boolean>();
public void addAdjustedState(String attr, boolean adjusted) {
Boolean b = fMap.get(attr);
if (b == null || (adjusted && !b.booleanValue())) {
fMap.put(attr, Boolean.valueOf(adjusted));
}
}
public String[] getUnadjusted() {
if (fMap.size() == 0)
return new String[0];
ArrayList<String> list = new ArrayList<String>(fMap.size());
Set<Entry<String, Boolean>> entrySet = fMap.entrySet();
for (Entry<String, Boolean> entry : entrySet) {
Boolean b = entry.getValue();
if (!b.booleanValue()) {
list.add(entry.getKey());
}
}
return list.toArray(new String[list.size()]);
}
}
|