Changeset 30737 in osm for applications/editors/josm/plugins/graphview/src/org
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReader.java
r26174 r30737 65 65 List<String> names; 66 66 if (parent == null) { 67 names = new LinkedList< String>();67 names = new LinkedList<>(); 68 68 } else { 69 69 names = parent.getAncestorHierarchy(); … … 74 74 } 75 75 76 private final Collection<AccessClass> accessClasses = new LinkedList< AccessClass>();77 private final Collection<Tag> baseTags = new LinkedList< Tag>();76 private final Collection<AccessClass> accessClasses = new LinkedList<>(); 77 private final Collection<Tag> baseTags = new LinkedList<>(); 78 78 79 79 private static enum Section {NONE, CLASSES, BASETAGS, IMPLICATIONS}; … … 83 83 84 84 private ImplicationXMLReader implicationReader = null; 85 private final List<Implication> implications = new LinkedList< Implication>();85 private final List<Implication> implications = new LinkedList<>(); 86 86 87 87 /** returns the AccessRuleset that was read */ … … 96 96 } 97 97 } 98 return new LinkedList< String>();98 return new LinkedList<>(); 99 99 } 100 100 -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/Implication.java
r23189 r30737 34 34 if (condition.matches(tags)) { 35 35 36 Map<String, String> newTagMap = new HashMap< String, String>();36 Map<String, String> newTagMap = new HashMap<>(); 37 37 38 38 for (Tag tag : tags) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/ImplicationXMLReader.java
r30497 r30737 19 19 public class ImplicationXMLReader { 20 20 21 private final List<Implication> implications = new LinkedList< Implication>();21 private final List<Implication> implications = new LinkedList<>(); 22 22 23 23 private static enum State {BEFORE_IMPLICATION, BEFORE_CONDITION, CONDITION, BEFORE_IMPLIES, IMPLIES, AFTER_IMPLIES}; … … 58 58 59 59 if ("implies".equals(name)) { 60 currentImpliedTags = new LinkedList< Tag>();60 currentImpliedTags = new LinkedList<>(); 61 61 state = State.IMPLIES; 62 62 return; … … 137 137 throw new SAXException(tr("Some tags have not been closed; now in state {0}", state)); 138 138 } else { 139 return new ArrayList< Implication>(implications);139 return new ArrayList<>(implications); 140 140 } 141 141 } … … 175 175 boolean finished; 176 176 177 private final List<ConditionReader> childReaders = new LinkedList< ConditionReader>();177 private final List<ConditionReader> childReaders = new LinkedList<>(); 178 178 private ConditionReader currentChildReader = null; 179 179 … … 234 234 if (openingName.equals(name)) { 235 235 236 List<TagCondition> childConditions = new ArrayList< TagCondition>();236 List<TagCondition> childConditions = new ArrayList<>(); 237 237 for (ConditionReader childReader : childReaders) { 238 238 childConditions.add(childReader.getCondition()); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/RulesetAccessEvaluator.java
r23189 r30737 126 126 */ 127 127 128 Map<String, AccessType> accessTypePerClass = new HashMap< String, AccessType>();128 Map<String, AccessType> accessTypePerClass = new HashMap<>(); 129 129 130 130 for (String accessClass : accessClasses) { … … 155 155 /* evaluate implied tagging of other tags */ 156 156 157 Map<String, String> tagMap = new HashMap< String, String>();157 Map<String, String> tagMap = new HashMap<>(); 158 158 for (Tag tag : wayTags) { 159 159 if (!tag.equals(baseTag)) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/MapBasedTagGroup.java
r23189 r30737 34 34 throw new IllegalArgumentException(); 35 35 } 36 this.tagMap = new HashMap< String, String>();36 this.tagMap = new HashMap<>(); 37 37 for (Tag tag : tags) { 38 38 if (tag == null) { … … 48 48 */ 49 49 public MapBasedTagGroup(Tag... tags) { 50 this.tagMap = new HashMap< String, String>(tags.length);50 this.tagMap = new HashMap<>(tags.length); 51 51 for (Tag tag : tags) { 52 52 if (tag == null) { … … 88 88 public Iterator<Tag> iterator() { 89 89 90 Collection<Tag> tagCollection = new LinkedList< Tag>();90 Collection<Tag> tagCollection = new LinkedList<>(); 91 91 92 92 for (String key : tagMap.keySet()) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/ConnectorEvaluationGroup.java
r26174 r30737 30 30 31 31 this.segments = segments; 32 this.borderNodes = new ArrayList< SegmentNode>(borderNodes);32 this.borderNodes = new ArrayList<>(borderNodes); 33 33 } 34 34 -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/EvaluationGroup.java
r23189 r30737 77 77 activeRestrictionsAfterSegment(firstSegment, EMPTY_RESTRICTION_LIST, restrictions); 78 78 79 Collection<Restriction> restrictionsForbiddenAtLastNode = new HashSet< Restriction>();79 Collection<Restriction> restrictionsForbiddenAtLastNode = new HashSet<>(); 80 80 for (Restriction restriction : restrictions) { 81 81 if (restriction.getTos().contains(lastSegment)) { … … 110 110 } 111 111 112 Queue<State> stateQueue = new LinkedList< State>();112 Queue<State> stateQueue = new LinkedList<>(); 113 113 stateQueue.add(createStartingState(firstNode, initiallyActiveRestrictions)); 114 114 … … 143 143 startingState.activeRestrictions = initiallyActiveRestrictions; 144 144 startingState.segmentHistory = EMPTY_SEGMENT_LIST; 145 startingState.visitedNodes = new HashSet< SegmentNode>();145 startingState.visitedNodes = new HashSet<>(); 146 146 startingState.visitedNodes.add(firstNode); 147 147 … … 151 151 private List<State> createSubsequentStates(State state, Collection<Restriction> allRestrictions) { 152 152 153 List<State> subsequentStates = new ArrayList< State>();153 List<State> subsequentStates = new ArrayList<>(); 154 154 155 155 for (Segment segment : state.currentNode.getOutboundSegments()) { … … 163 163 segment, state.activeRestrictions, allRestrictions); 164 164 165 newState.segmentHistory = new ArrayList< Segment>(state.segmentHistory.size() + 1);165 newState.segmentHistory = new ArrayList<>(state.segmentHistory.size() + 1); 166 166 newState.segmentHistory.addAll(state.segmentHistory); 167 167 newState.segmentHistory.add(segment); … … 169 169 newState.currentNode = segment.getNode2(); 170 170 171 newState.visitedNodes = new HashSet< SegmentNode>(state.visitedNodes);171 newState.visitedNodes = new HashSet<>(state.visitedNodes); 172 172 newState.visitedNodes.add(newState.currentNode); 173 173 … … 200 200 if (restriction.getFrom() == segment) { 201 201 if (result == EMPTY_RESTRICTION_LIST) { 202 result = new ArrayList< Restriction>(restrictions.size());202 result = new ArrayList<>(restrictions.size()); 203 203 } 204 204 result.add(restriction); … … 218 218 if (restriction.getVias().contains(segment)) { 219 219 if (result == EMPTY_RESTRICTION_LIST) { 220 result = new ArrayList< Restriction>(allRestrictions.size());220 result = new ArrayList<>(allRestrictions.size()); 221 221 } 222 222 result.add(restriction); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/JunctionEvaluationGroup.java
r26174 r30737 84 84 * is in the set and whose start node isn't (analogous for outbound segments) */ 85 85 86 inboundSegments = new ArrayList< Segment>();87 outboundSegments = new ArrayList< Segment>();86 inboundSegments = new ArrayList<>(); 87 outboundSegments = new ArrayList<>(); 88 88 89 89 for (SegmentNode segmentNode : segmentNodes) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/TSBasedWayGraph.java
r29854 r30737 30 30 private final SegmentNode node; 31 31 private final Segment segment; 32 private final List<GraphEdge> incomingEdges = new ArrayList< GraphEdge>();33 private final List<GraphEdge> outgoingEdges = new ArrayList< GraphEdge>();32 private final List<GraphEdge> incomingEdges = new ArrayList<>(); 33 private final List<GraphEdge> outgoingEdges = new ArrayList<>(); 34 34 public GraphNodeImpl(SegmentNode node, Segment segment) { 35 35 assert node != null && segment != null; … … 101 101 }; 102 102 103 private final Set<WayGraphObserver> observers = new HashSet< WayGraphObserver>();103 private final Set<WayGraphObserver> observers = new HashSet<>(); 104 104 105 105 private final TransitionStructure transitionStructure; … … 147 147 148 148 Map<SegmentNode, Set<SegmentNode>> nodeSetMap = 149 new HashMap< SegmentNode, Set<SegmentNode>>();149 new HashMap<>(); 150 150 151 151 /* first step: everything that is part of the same restriction goes into the same set */ … … 189 189 190 190 Map<Segment, Set<Segment>> segmentSetMap = 191 new HashMap< Segment, Set<Segment>>();191 new HashMap<>(); 192 192 193 193 for (Segment segment : transitionStructure.getSegments()) { … … 218 218 219 219 Collection<EvaluationGroup> evaluationGroups = 220 new ArrayList< EvaluationGroup>(nodeSetMap.size() + segmentSetMap.size());221 222 Set<Set<SegmentNode>> nodeSets = new HashSet< Set<SegmentNode>>(nodeSetMap.values());220 new ArrayList<>(nodeSetMap.size() + segmentSetMap.size()); 221 222 Set<Set<SegmentNode>> nodeSets = new HashSet<>(nodeSetMap.values()); 223 223 for (Set<SegmentNode> nodeSet : nodeSets) { 224 224 evaluationGroups.add(new JunctionEvaluationGroup(nodeSet)); 225 225 } 226 226 227 HashSet<Set<Segment>> hashSets = new HashSet< Set<Segment>>(segmentSetMap.values());227 HashSet<Set<Segment>> hashSets = new HashSet<>(segmentSetMap.values()); 228 228 for (Set<Segment> segmentSet : hashSets) { 229 Set<SegmentNode> borderNodes = new HashSet< SegmentNode>();229 Set<SegmentNode> borderNodes = new HashSet<>(); 230 230 for (Segment segment : segmentSet) { 231 231 if (nodeSetMap.containsKey(segment.getNode1())) { … … 245 245 Collection<EvaluationGroup> evaluationGroups) { 246 246 247 nodes = new LinkedList< GraphNode>();248 edges = new LinkedList< GraphEdge>();247 nodes = new LinkedList<>(); 248 edges = new LinkedList<>(); 249 249 250 250 //map from Segments to GraphNodes; 251 251 //for those GraphNodes representing an "approaching node on segment" state 252 252 final Map<Segment, GraphNodeImpl> segment2GNMap_approaching = 253 new HashMap< Segment, GraphNodeImpl>();253 new HashMap<>(); 254 254 255 255 //map from Segments to GraphNodes; 256 256 //for those GraphNodes representing a "leaving node on segment" state 257 257 final Map<Segment, GraphNodeImpl> segment2GNMap_leaving = 258 new HashMap< Segment, GraphNodeImpl>();258 new HashMap<>(); 259 259 260 260 //map from SegmentNodes to GraphNode collections; 261 261 //for those GraphNodes representing an "approaching node on segment" state 262 262 final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_approaching = 263 new HashMap< SegmentNode, Collection<GraphNodeImpl>>();263 new HashMap<>(); 264 264 265 265 //map from SegmentNodes to GraphNodes collections; 266 266 //for those GraphNodes representing a "leaving node on segment" state 267 267 final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_leaving = 268 new HashMap< SegmentNode, Collection<GraphNodeImpl>>();268 new HashMap<>(); 269 269 270 270 … … 366 366 367 367 Map<GraphEdgePropertyType<?>, Object> properties = 368 new HashMap< GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution368 new HashMap<>(); //TODO: replace HashMap with List-based solution 369 369 370 370 for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) { … … 382 382 383 383 Map<GraphEdgePropertyType<?>, Object> properties = 384 new HashMap< GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution384 new HashMap<>(); //TODO: replace HashMap with List-based solution 385 385 386 386 for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) { … … 411 411 private static boolean isConnectedWithExactly2Nodes(SegmentNode node) { 412 412 413 Set<SegmentNode> connectedNodes = new HashSet< SegmentNode>(2);413 Set<SegmentNode> connectedNodes = new HashSet<>(2); 414 414 415 415 for (Segment segment : node.getInboundSegments()) { … … 430 430 431 431 if (!objectSetMap.containsKey(object)) { 432 Set<T> set = new HashSet< T>();432 Set<T> set = new HashSet<>(); 433 433 set.add(object); 434 434 objectSetMap.put(object, set); … … 472 472 private static <K, E> void addToCollectionMap(final Map<K, Collection<E>> map, K key, E entry) { 473 473 if (!map.containsKey(key)) { 474 Collection<E> newCollection = new ArrayList< E>();474 Collection<E> newCollection = new ArrayList<>(); 475 475 map.put(key, newCollection); 476 476 } -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/GenericTransitionStructure.java
r29854 r30737 33 33 Collections.unmodifiableList(new ArrayList<Segment>(0)); 34 34 private static final Collection<Restriction> EMPTY_RESTRICTION_COLLECTION = 35 new ArrayList< Restriction>(0);35 new ArrayList<>(0); 36 36 37 37 private static class SegmentNodeImpl implements SegmentNode { 38 38 private final double lat; 39 39 private final double lon; 40 private final List<Segment> inboundSegments = new LinkedList< Segment>();41 private final List<Segment> outboundSegments = new LinkedList< Segment>();40 private final List<Segment> inboundSegments = new LinkedList<>(); 41 private final List<Segment> outboundSegments = new LinkedList<>(); 42 42 private final Map<RoadPropertyType<?>, Object> properties; 43 43 public SegmentNodeImpl(double lat, double lon, Map<RoadPropertyType<?>, Object> properties) { … … 148 148 } 149 149 150 private final Set<TransitionStructureObserver> observers = new HashSet< TransitionStructureObserver>();150 private final Set<TransitionStructureObserver> observers = new HashSet<>(); 151 151 152 152 private final Collection<RoadPropertyType<?>> properties; … … 160 160 161 161 private Collection<SegmentNode> nodes = null; 162 private Collection<Segment> segments = new LinkedList< Segment>();163 private Collection<Restriction> restrictions = new LinkedList< Restriction>();162 private Collection<Segment> segments = new LinkedList<>(); 163 private Collection<Restriction> restrictions = new LinkedList<>(); 164 164 165 165 public GenericTransitionStructure( … … 201 201 assert dataSource != null; 202 202 203 accessEvaluator = new RulesetAccessEvaluator< N, W, R, M>(203 accessEvaluator = new RulesetAccessEvaluator<>( 204 204 dataSource, 205 205 this.ruleset, … … 230 230 protected void updateData() { 231 231 232 ArrayList<SegmentNode> nodes = new ArrayList< SegmentNode>();233 ArrayList<Segment> segments = new ArrayList< Segment>();234 235 Map<N, SegmentNodeImpl> nodeCreationMap = new HashMap< N, SegmentNodeImpl>();236 Map<W, List<Segment>> waySegmentMap = new HashMap< W, List<Segment>>();232 ArrayList<SegmentNode> nodes = new ArrayList<>(); 233 ArrayList<Segment> segments = new ArrayList<>(); 234 235 Map<N, SegmentNodeImpl> nodeCreationMap = new HashMap<>(); 236 Map<W, List<Segment>> waySegmentMap = new HashMap<>(); 237 237 238 238 /* create segments (nodes are created only when included in a segment) */ … … 372 372 assert relations != null && nodeCreationMap != null && waySegmentMap != null; 373 373 374 Collection<Restriction> results = new LinkedList< Restriction>();374 Collection<Restriction> results = new LinkedList<>(); 375 375 376 376 for (R relation : relations) { … … 404 404 405 405 W fromWay = null; 406 Collection<N> viaNodes = new LinkedList< N>();407 Collection<W> viaWays = new LinkedList< W>();408 Collection<W> toWays = new LinkedList< W>();406 Collection<N> viaNodes = new LinkedList<>(); 407 Collection<W> viaWays = new LinkedList<>(); 408 Collection<W> toWays = new LinkedList<>(); 409 409 410 410 for (M member : dataSource.getMembers(relation)) { … … 442 442 443 443 } else { 444 return new ArrayList< Restriction>(0);444 return new ArrayList<>(0); 445 445 } 446 446 } … … 451 451 W fromWay, Collection<N> viaNodes, Collection<W> viaWays, Collection<W> toWays) { 452 452 453 Collection<SegmentNode> nodesCreatedFromViaNodes = new ArrayList< SegmentNode>(viaNodes.size());453 Collection<SegmentNode> nodesCreatedFromViaNodes = new ArrayList<>(viaNodes.size()); 454 454 for (N viaNode : viaNodes) { 455 455 if (nodeCreationMap.containsKey(viaNode)) { … … 483 483 * or segments starting and ending with nodes created from via nodes */ 484 484 485 ArrayList<Segment> viaSegments = new ArrayList< Segment>();485 ArrayList<Segment> viaSegments = new ArrayList<>(); 486 486 487 487 for (W viaWay : viaWays) { … … 502 502 503 503 Set<SegmentNode> nodesCreatedFromViaMembers 504 = new HashSet< SegmentNode>(nodesCreatedFromViaNodes);504 = new HashSet<>(nodesCreatedFromViaNodes); 505 505 506 506 for (W viaWay : viaWays) { … … 518 518 519 519 Segment fromSegment = null; 520 Collection<Segment> toSegments = new ArrayList< Segment>();520 Collection<Segment> toSegments = new ArrayList<>(); 521 521 522 522 for (Segment possibleFromSegment : waySegmentMap.get(fromWay)) { … … 595 595 /* create restriction */ 596 596 597 Collection<Restriction> results = new ArrayList< Restriction>(1);597 Collection<Restriction> results = new ArrayList<>(1); 598 598 results.add(new RestrictionImpl(fromSegment, viaSegments, toSegments)); 599 599 return results; … … 618 618 assert waySegmentMap != null; 619 619 620 Collection<Restriction> results = new LinkedList< Restriction>();620 Collection<Restriction> results = new LinkedList<>(); 621 621 622 622 for (N node : nodeCreationMap.keySet()) { … … 645 645 private Map<RoadPropertyType<?>, Object> getWayPropertyMap(W way, boolean forward) { 646 646 Map<RoadPropertyType<?>, Object> propertyValues; 647 propertyValues = new HashMap< RoadPropertyType<?>, Object>();647 propertyValues = new HashMap<>(); 648 648 for (RoadPropertyType<?> property : properties) { 649 649 Object value = property.evaluateW(way, forward, accessParameters, dataSource); … … 661 661 private Map<RoadPropertyType<?>, Object> getNodePropertyMap(N node) { 662 662 Map<RoadPropertyType<?>, Object> propertyValues; 663 propertyValues = new HashMap< RoadPropertyType<?>, Object>();663 propertyValues = new HashMap<>(); 664 664 for (RoadPropertyType<?> property : properties) { 665 665 Object value = property.evaluateN(node, accessParameters, dataSource); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorScheme.java
r23189 r30737 38 38 39 39 this.propertyClass = propertyClass; 40 this.colorMap = new HashMap< Float, Color>(colorMap);40 this.colorMap = new HashMap<>(colorMap); 41 41 this.defaultColor = defaultColor; 42 42 } … … 65 65 public Color getNodeColor(GraphNode node) { 66 66 67 List<Color> segmentColors = new ArrayList< Color>();67 List<Color> segmentColors = new ArrayList<>(); 68 68 69 69 … … 106 106 } else { 107 107 108 LinkedList<Float> valuesWithDefinedColor = new LinkedList< Float>(colorMap.keySet());108 LinkedList<Float> valuesWithDefinedColor = new LinkedList<>(colorMap.keySet()); 109 109 Collections.sort(valuesWithDefinedColor); 110 110 -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/InclineColorScheme.java
r23189 r30737 15 15 16 16 static { 17 COLOR_MAP = new HashMap< Float, Color>();17 COLOR_MAP = new HashMap<>(); 18 18 COLOR_MAP.put(-30f, Color.BLUE); 19 19 COLOR_MAP.put(0f, Color.WHITE); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxheightColorScheme.java
r23189 r30737 15 15 16 16 static { 17 COLOR_MAP = new HashMap< Float, Color>();17 COLOR_MAP = new HashMap<>(); 18 18 COLOR_MAP.put(0f, new Color(0, 0, 50)); 19 19 COLOR_MAP.put(10f, new Color(100, 100, 255)); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxspeedColorScheme.java
r23189 r30737 15 15 16 16 static { 17 COLOR_MAP = new HashMap< Float, Color>();17 COLOR_MAP = new HashMap<>(); 18 18 COLOR_MAP.put(0f, new Color(50, 0, 0)); 19 19 COLOR_MAP.put(30f, Color.RED); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxweightColorScheme.java
r23189 r30737 15 15 16 16 static { 17 COLOR_MAP = new HashMap< Float, Color>();17 COLOR_MAP = new HashMap<>(); 18 18 COLOR_MAP.put(0f, new Color(0, 0, 50)); 19 19 COLOR_MAP.put(20f, new Color(100, 100, 255)); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java
r30145 r30737 57 57 58 58 static { 59 PROPERTIES = new LinkedList< RoadPropertyType<?>>();59 PROPERTIES = new LinkedList<>(); 60 60 PROPERTIES.add(new RoadIncline()); 61 61 PROPERTIES.add(new RoadMaxaxleload()); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMDataSource.java
r23189 r30737 39 39 40 40 public Iterable<Node> getNodes(Way way) { 41 return new FilteredOsmPrimitiveIterable< Node>(way.getNodes());41 return new FilteredOsmPrimitiveIterable<>(way.getNodes()); 42 42 } 43 43 44 44 public Iterable<Node> getNodes() { 45 return new FilteredOsmPrimitiveIterable< Node>(Main.main.getCurrentDataSet().getNodes());45 return new FilteredOsmPrimitiveIterable<>(Main.main.getCurrentDataSet().getNodes()); 46 46 } 47 47 … … 51 51 52 52 public Iterable<Way> getWays() { 53 return new FilteredOsmPrimitiveIterable< Way>(Main.main.getCurrentDataSet().getWays());53 return new FilteredOsmPrimitiveIterable<>(Main.main.getCurrentDataSet().getWays()); 54 54 } 55 55 … … 97 97 private static final TagGroup EMPTY_TAG_GROUP; 98 98 static { 99 Map<String, String> emptyMap = new HashMap< String, String>(0);99 Map<String, String> emptyMap = new HashMap<>(0); 100 100 EMPTY_TAG_GROUP = new MapBasedTagGroup(emptyMap); 101 101 } … … 204 204 } 205 205 206 private final Set<DataSourceObserver> observers = new HashSet< DataSourceObserver>();206 private final Set<DataSourceObserver> observers = new HashSet<>(); 207 207 208 208 public void addObserver(DataSourceObserver observer) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/AccessParameterDialog.java
r29854 r30737 50 50 51 51 static { 52 FLOAT_PROPERTIES = new LinkedHashMap< VehiclePropertyType<Float>, String>();52 FLOAT_PROPERTIES = new LinkedHashMap<>(); 53 53 FLOAT_PROPERTIES.put(VehiclePropertyTypes.HEIGHT, tr("height (m)")); 54 54 FLOAT_PROPERTIES.put(VehiclePropertyTypes.WIDTH, tr("width (m)")); … … 132 132 133 133 private final Map<AccessType, JCheckBox> accessTypeCheckBoxes = 134 new EnumMap< AccessType, JCheckBox>(AccessType.class);134 new EnumMap<>(AccessType.class); 135 135 136 136 public AccessTypesPanel(PreferenceAccessParameters initialParameters) { … … 152 152 public Collection<AccessType> getUsableAccessTypes() { 153 153 154 Collection<AccessType> usableAccessTypes = new LinkedList< AccessType>();154 Collection<AccessType> usableAccessTypes = new LinkedList<>(); 155 155 156 156 for (AccessType accessType : AccessType.values()) { … … 169 169 170 170 private final Map<VehiclePropertyType<Float>, JTextField> floatPropertyTextFields = 171 new HashMap< VehiclePropertyType<Float>, JTextField>();171 new HashMap<>(); 172 172 173 173 public VehiclePropertiesPanel(PreferenceAccessParameters initialParameters) { … … 200 200 201 201 Map<VehiclePropertyType<?>, String> vehiclePropertyStrings = 202 new HashMap< VehiclePropertyType<?>, String>();202 new HashMap<>(); 203 203 204 204 for (VehiclePropertyType<Float> vehicleProperty : floatPropertyTextFields.keySet()) { … … 310 310 311 311 Map<VehiclePropertyType<?>, String> vehiclePropertyStrings = 312 new HashMap< VehiclePropertyType<?>, String>();312 new HashMap<>(); 313 313 314 314 String incUpString = inclineUpTextField.getText(); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java
r30532 r30737 73 73 this.plugin = plugin; 74 74 75 availableColorSchemes = new LinkedHashMap< String, ColorScheme>();75 availableColorSchemes = new LinkedHashMap<>(); 76 76 77 77 availableColorSchemes.put(tr("default"), … … 238 238 } else { 239 239 240 rulesetFiles = new LinkedList< File>();240 rulesetFiles = new LinkedList<>(); 241 241 242 242 File[] filesInRulesetFolder = preferences.getRulesetFolder().listFiles(); … … 273 273 274 274 String activeBookmarkName = preferences.getCurrentParameterBookmarkName(); 275 Set<String> bookmarkNames = new HashSet< String>(preferences.getParameterBookmarks().keySet());275 Set<String> bookmarkNames = new HashSet<>(preferences.getParameterBookmarks().keySet()); 276 276 277 277 bookmarkComboBox.removeAllItems(); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java
r30532 r30737 101 101 102 102 parameterBookmarks = 103 new HashMap< String, PreferenceAccessParameters>(preferences.getParameterBookmarks());103 new HashMap<>(preferences.getParameterBookmarks()); 104 104 105 105 } … … 349 349 parameterBookmarks.get(selectedBookmarkName); 350 350 351 Collection<String> otherBookmarkNames = new LinkedList< String>();351 Collection<String> otherBookmarkNames = new LinkedList<>(); 352 352 for (String bookmarkName : parameterBookmarks.keySet()) { 353 353 if (!bookmarkName.equals(selectedBookmarkName)) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferenceDefaults.java
r23189 r30737 32 32 33 33 Map<VehiclePropertyType<?>, String> propertyStringMap = 34 new HashMap< VehiclePropertyType<?>, String>();34 new HashMap<>(); 35 35 36 36 try { … … 48 48 49 49 Map<String, PreferenceAccessParameters> result = 50 new HashMap< String, PreferenceAccessParameters>();50 new HashMap<>(); 51 51 52 52 Collection<AccessType> accessTypes = … … 56 56 { 57 57 Map<VehiclePropertyType<?>, String> propertyMap = 58 new HashMap< VehiclePropertyType<?>, String>();58 new HashMap<>(); 59 59 60 60 PreferenceAccessParameters accessParameters = … … 67 67 { 68 68 Map<VehiclePropertyType<?>, String> propertyMap = 69 new HashMap< VehiclePropertyType<?>, String>();69 new HashMap<>(); 70 70 propertyMap.put(VehiclePropertyTypes.WEIGHT, "3.5"); 71 71 … … 79 79 { 80 80 Map<VehiclePropertyType<?>, String> propertyMap = 81 new HashMap< VehiclePropertyType<?>, String>();81 new HashMap<>(); 82 82 83 83 PreferenceAccessParameters accessParameters = … … 90 90 { 91 91 Map<VehiclePropertyType<?>, String> propertyMap = 92 new HashMap< VehiclePropertyType<?>, String>();92 new HashMap<>(); 93 93 94 94 PreferenceAccessParameters accessParameters = -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferences.java
r27760 r30737 146 146 147 147 this.parameterBookmarks = 148 new HashMap< String, PreferenceAccessParameters>(parameterBookmarks);148 new HashMap<>(parameterBookmarks); 149 149 } 150 150 … … 325 325 326 326 private static final Map<VehiclePropertyType<?>, String> VEHICLE_PROPERTY_TYPE_NAME_MAP = 327 new HashMap< VehiclePropertyType<?>, String>();327 new HashMap<>(); 328 328 329 329 … … 412 412 413 413 Map<String, PreferenceAccessParameters> resultMap = 414 new HashMap< String, PreferenceAccessParameters>();414 new HashMap<>(); 415 415 416 416 String[] bookmarkStrings = string.split("\\|"); … … 435 435 436 436 String[] accessTypeStrings = matcher.group(3).split(","); 437 Collection<AccessType> accessTypes = new LinkedList< AccessType>();437 Collection<AccessType> accessTypes = new LinkedList<>(); 438 438 for (String accessTypeString : accessTypeStrings) { 439 439 AccessType accessType = AccessType.valueOf(accessTypeString); … … 446 446 String[] vehiclePropertyStrings = matcher.group(4).split(","); 447 447 Map<VehiclePropertyType<?>, String> vehiclePropertyMap = 448 new HashMap< VehiclePropertyType<?>, String>();448 new HashMap<>(); 449 449 450 450 for (String vehiclePropertyString : vehiclePropertyStrings) { -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/PreferenceAccessParameters.java
r23189 r30737 79 79 this.accessClass = accessClass; 80 80 81 accessTypeUsableMap = new EnumMap< AccessType, Boolean>(AccessType.class);81 accessTypeUsableMap = new EnumMap<>(AccessType.class); 82 82 for (AccessType accessType : AccessType.values()) { 83 83 accessTypeUsableMap.put(accessType, usableAccessTypes.contains(accessType)); … … 87 87 88 88 this.vehiclePropertyStrings = Collections.unmodifiableMap( 89 new HashMap< VehiclePropertyType<?>, String>(vehiclePropertyStrings));89 new HashMap<>(vehiclePropertyStrings)); 90 90 91 this.vehiclePropertyValues = new HashMap< VehiclePropertyType<?>, Object>();91 this.vehiclePropertyValues = new HashMap<>(); 92 92 for (VehiclePropertyType<?> vehiclePropertyType : vehiclePropertyStrings.keySet()) { 93 93 String propertyValueString = vehiclePropertyStrings.get(vehiclePropertyType); -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/VehiclePropertyStringParser.java
r26465 r30737 132 132 133 133 String[] surfaces = propertyValueString.split(";\\s*"); 134 Collection<String> surfaceBlacklist = new ArrayList< String>(surfaces.length);134 Collection<String> surfaceBlacklist = new ArrayList<>(surfaces.length); 135 135 for (String surface : surfaces) { 136 136 for (char nameChar : surface.toCharArray()) {
Note:
See TracChangeset
for help on using the changeset viewer.