Debian Codegraph @

arduino-core/src/processing/app/debug/LegacyTargetPackage.java

raw symbols SCIP
1 /*
2 TargetPackage - Represents a hardware package
3 Part of the Arduino project - http://www.arduino.cc/
4
5 Copyright (c) 2011 Cristian Maglie
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 package processing.app.debug;
22
23 import java.util.Collection;
24 import java.util.LinkedHashMap;
25 import java.util.Map;
26
27 public class LegacyTargetPackage implements TargetPackage {
28
29 private final String id;
30 private final Map<String, TargetPlatform> platforms;
31
32 public LegacyTargetPackage(String _id) {
33 id = _id;
34 platforms = new LinkedHashMap<>();
35 }
36
37 @Override
38 public Map<String, TargetPlatform> getPlatforms() {
39 return platforms;
40 }
41
42 @Override
43 public Collection<TargetPlatform> platforms() {
44 return platforms.values();
45 }
46
47 @Override
48 public TargetPlatform get(String platform) {
49 return platforms.get(platform);
50 }
51
52 @Override
53 public boolean hasPlatform(TargetPlatform platform) {
54 return platforms.containsKey(platform.getId());
55 }
56
57 @Override
58 public String getId() {
59 return id;
60 }
61 }