Changeset 30737 in osm for applications/editors/josm/plugins/junctionchecking
- Timestamp:
- 2014-10-18T23:07:52+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckTask.java
r30725 r30737 76 76 protected void realRun() throws SAXException, IOException, 77 77 OsmTransferException { 78 jc.checkjunctions(new ArrayList< Channel>(subset), getProgressMonitor());78 jc.checkjunctions(new ArrayList<>(subset), getProgressMonitor()); 79 79 } 80 80 -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionSearchTask.java
r30725 r30737 64 64 protected void realRun() throws SAXException, IOException, 65 65 OsmTransferException { 66 jc.junctionSearch(new ArrayList< Channel>(subset), getProgressMonitor());66 jc.junctionSearch(new ArrayList<>(subset), getProgressMonitor()); 67 67 } 68 68 -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/PrepareJunctionCheckorSearch.java
r30725 r30737 23 23 this.plugin = plugin; 24 24 this.n = n; 25 this.subset = new HashSet< Channel>();25 this.subset = new HashSet<>(); 26 26 this.produceRelation = producerelation; 27 27 } -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/commandlineinterface/CLI.java
r30725 r30737 91 91 92 92 JunctionChecker jc = new JunctionChecker(cdgb.getDigraph(), n); 93 ArrayList<Channel> subset = new ArrayList< Channel>();93 ArrayList<Channel> subset = new ArrayList<>(); 94 94 95 95 Channel seed = new Channel(); -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/connectedness/DiGraphSealer.java
r30725 r30737 34 34 */ 35 35 public void sealingGraph() { 36 Vector<Integer> outgoingChannelIDs = new Vector< Integer>();37 Vector<Integer> incomingChannelIDs = new Vector< Integer>();36 Vector<Integer> outgoingChannelIDs = new Vector<>(); 37 Vector<Integer> incomingChannelIDs = new Vector<>(); 38 38 39 39 for (int i = 0; i < digraph.numberOfChannels(); i++) { -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/connectedness/StrongConnectednessCalculator.java
r30725 r30737 8 8 9 9 private int index = 0; 10 private final ArrayList<Channel> stack = new ArrayList< Channel>();11 private final ArrayList<ArrayList<Channel>> SCC = new ArrayList< ArrayList<Channel>>();10 private final ArrayList<Channel> stack = new ArrayList<>(); 11 private final ArrayList<ArrayList<Channel>> SCC = new ArrayList<>(); 12 12 private final int numberOfNodes; 13 13 private int calculatedNodes = 0; 14 private ArrayList<Channel> nsccchannels = new ArrayList< Channel>();14 private ArrayList<Channel> nsccchannels = new ArrayList<>(); 15 15 private final ChannelDiGraph digraph; 16 16 int biggestPart = 0; … … 57 57 **/ 58 58 private void saveNotSCCChannel() { 59 nsccchannels = new ArrayList< Channel>();59 nsccchannels = new ArrayList<>(); 60 60 for (int i = 0; i < SCC.size(); i++) { 61 61 if (i != biggestPart) { … … 124 124 if (v.getLowlink() == v.getIndex()) { 125 125 Channel n; 126 ArrayList<Channel> component = new ArrayList< Channel>();126 ArrayList<Channel> component = new ArrayList<>(); 127 127 do { 128 128 n = stack.remove(0); -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/converting/TurnRestrictionChecker.java
r30725 r30737 18 18 public class TurnRestrictionChecker { 19 19 20 private final ArrayList<OSMRelation> turnrestrictionsrelations = new ArrayList< OSMRelation>();20 private final ArrayList<OSMRelation> turnrestrictionsrelations = new ArrayList<>(); 21 21 private final ChannelDiGraph channelDigraph; 22 22 private int relationpointer; -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/BasicChannel.java
r30725 r30737 11 11 private OSMNode toNode; 12 12 private OSMNode fromNode; 13 private ArrayList<LeadsTo> leadsTo = new ArrayList< LeadsTo>();14 private final ArrayList<OSMWay> ways = new ArrayList< OSMWay>();13 private ArrayList<LeadsTo> leadsTo = new ArrayList<>(); 14 private final ArrayList<OSMWay> ways = new ArrayList<>(); 15 15 private int newid; 16 16 //gibt es nur, wenn ein Channelobjekt aus einer Nichteinbahnstraße erzeugt wurde (backchannelID ist dann die ID des anderen Channels) 17 17 private int backChannelID = -100; 18 private final ArrayList<Channel> predChannels = new ArrayList< Channel>();18 private final ArrayList<Channel> predChannels = new ArrayList<>(); 19 19 20 20 //werden für den Tarjan-Algorithmus gebraucht -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/Channel.java
r30725 r30737 17 17 private boolean subgraph; 18 18 private int visited = BacktrackingColors.WHITE; 19 private final ArrayList<Channel> reachableNodes = new ArrayList< Channel>();19 private final ArrayList<Channel> reachableNodes = new ArrayList<>(); 20 20 private int ennr; 21 21 private boolean isStrongConnected = true; … … 23 23 private boolean isPartOfJunction = false; //wird für den eigenen Layer benötigt, um Teile einer Kreuzung farbig repräsentieren zu können 24 24 25 private final HashMap<Channel , ArrayList<Channel>> paths2 = new HashMap< Channel , ArrayList<Channel>>();25 private final HashMap<Channel , ArrayList<Channel>> paths2 = new HashMap<>(); 26 26 27 27 … … 197 197 */ 198 198 public ArrayList<ArrayList<Channel>> getPaths() { 199 ArrayList<ArrayList<Channel>> t = new ArrayList< ArrayList<Channel>>();199 ArrayList<ArrayList<Channel>> t = new ArrayList<>(); 200 200 t.addAll(paths2.values()); 201 201 return t; -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/ChannelDiGraph.java
r30725 r30737 11 11 public class ChannelDiGraph extends Graph { 12 12 13 private ArrayList<Channel> channels = new ArrayList< Channel>();14 private final ArrayList<LeadsTo> leadsTos = new ArrayList< LeadsTo>();15 private final HashSet<Channel> selectedChannels = new HashSet< Channel>();16 private HashSet<Channel> junctioncandidate = new HashSet< Channel>();13 private ArrayList<Channel> channels = new ArrayList<>(); 14 private final ArrayList<LeadsTo> leadsTos = new ArrayList<>(); 15 private final HashSet<Channel> selectedChannels = new HashSet<>(); 16 private HashSet<Channel> junctioncandidate = new HashSet<>(); 17 17 18 18 public void setChannels(ArrayList<Channel> channels) { … … 100 100 */ 101 101 public OSMNode[] getAllOSMNodes() { 102 HashMap<Long, OSMNode> nodes = new HashMap< Long, OSMNode>();102 HashMap<Long, OSMNode> nodes = new HashMap<>(); 103 103 for (int i = 0; i < channels.size(); i++) { 104 104 if (!nodes.containsKey(channels.get(i).getFromNode().getId())) { … … 185 185 */ 186 186 public ArrayList<Channel> getChannelsTouchingOSMNodes (ArrayList<OSMNode> nodes) { 187 ArrayList<Channel> touchingChannel = new ArrayList< Channel>();187 ArrayList<Channel> touchingChannel = new ArrayList<>(); 188 188 for (int i = 0; i < nodes.size(); i++) { 189 189 for (int j = 0; j < channels.size(); j++) { … … 204 204 205 205 public ArrayList<Channel> getChannelsTouchingOSMNode(long id) { 206 ArrayList<Channel> returnchannels = new ArrayList< Channel>();206 ArrayList<Channel> returnchannels = new ArrayList<>(); 207 207 for (int i = 0; i < channels.size(); i++) { 208 208 if (channels.get(i).getFromNode().getId() == id) { … … 223 223 */ 224 224 public ArrayList<Channel> getChannelsBetween(int idfrom, int idto) { 225 ArrayList<Channel> channelsresult = new ArrayList< Channel>();225 ArrayList<Channel> channelsresult = new ArrayList<>(); 226 226 for (int i = 0; i < channels.size(); i++) { 227 227 if (channels.get(i).getFromNode().getId() == idfrom) { … … 240 240 241 241 public ArrayList<Channel> getChannelswithWayID(int id) { 242 ArrayList<Channel> channelsresult = new ArrayList< Channel>();242 ArrayList<Channel> channelsresult = new ArrayList<>(); 243 243 for (int i = 0; i < channels.size(); i++) { 244 244 if (channels.get(i).getWay().getId() == id) { -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMEntity.java
r30725 r30737 38 38 * @uml.property name="hashmap" 39 39 */ 40 private HashMap<String, String> hashmap = new HashMap< String, String>();40 private HashMap<String, String> hashmap = new HashMap<>(); 41 41 /** 42 42 * @uml.property name="version" -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMGraph.java
r30725 r30737 16 16 public class OSMGraph extends Graph{ 17 17 18 private final HashMap<Long, OSMWay> ways = new HashMap< Long, OSMWay>();19 private HashMap<Long, OSMRelation> relations = new HashMap< Long, OSMRelation>();20 private final HashMap<Long, OSMNode> nodes = new HashMap< Long, OSMNode>();18 private final HashMap<Long, OSMWay> ways = new HashMap<>(); 19 private HashMap<Long, OSMRelation> relations = new HashMap<>(); 20 private final HashMap<Long, OSMNode> nodes = new HashMap<>(); 21 21 22 22 public void addNode(OSMNode node) { … … 86 86 public ArrayList<Long> getIDsfromWay(int id) { 87 87 OSMWay w = ways.get(id); 88 ArrayList<Long> ids = new ArrayList< Long>();88 ArrayList<Long> ids = new ArrayList<>(); 89 89 ids.add(w.getToNode().getId()); 90 90 ids.add(w.getFromNode().getId()); … … 97 97 OSMnode.setLatitude(node.getBBox().getTopLeft().lat()); 98 98 OSMnode.setLongitude(node.getBBox().getTopLeft().lon()); 99 OSMnode.setHashmap(new HashMap< String, String>(node.getKeys()));99 OSMnode.setHashmap(new HashMap<>(node.getKeys())); 100 100 nodes.put(OSMnode.getId(), OSMnode); 101 101 } … … 108 108 osmway.addNode(getNode(it.next().getId())); 109 109 } 110 osmway.setHashmap(new HashMap< String, String>(way.getKeys()));110 osmway.setHashmap(new HashMap<>(way.getKeys())); 111 111 ways.put(osmway.getId(), osmway); 112 112 } … … 115 115 OSMRelation osmrelation = new OSMRelation(); 116 116 osmrelation.setId(relation.getId()); 117 osmrelation.setHashmap(new HashMap< String, String>(relation.getKeys()));117 osmrelation.setHashmap(new HashMap<>(relation.getKeys())); 118 118 RelationMember rmember; 119 119 for (int i = 0; i < relation.getMembers().size(); i++) { -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMNode.java
r30725 r30737 11 11 private double latitude; 12 12 private double longitude; 13 private ArrayList<Channel> outgoingChannels = new ArrayList< Channel>();14 private ArrayList<OSMNode> succNodeList = new ArrayList< OSMNode>();15 private ArrayList<OSMNode> predNodeList = new ArrayList< OSMNode>();13 private ArrayList<Channel> outgoingChannels = new ArrayList<>(); 14 private ArrayList<OSMNode> succNodeList = new ArrayList<>(); 15 private ArrayList<OSMNode> predNodeList = new ArrayList<>(); 16 16 17 17 public void addOutgoingChannel(Channel channel) { -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMRelation.java
r30725 r30737 9 9 public class OSMRelation extends OSMEntity { 10 10 11 private ArrayList<Member> members = new ArrayList< Member>();11 private ArrayList<Member> members = new ArrayList<>(); 12 12 13 13 public void setMembers(ArrayList<Member> members) { -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMWay.java
r30725 r30737 8 8 public class OSMWay extends OSMEntity { 9 9 10 private Vector<OSMNode> nodes = new Vector< OSMNode>();10 private Vector<OSMNode> nodes = new Vector<>(); 11 11 12 12 public OSMNode[] getNodes() { -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/filter/Filter.java
r30725 r30737 9 9 public class Filter { 10 10 11 private HashSet<String> tagValues = new HashSet< String>();11 private HashSet<String> tagValues = new HashSet<>(); 12 12 private String keyValue; 13 13 -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JMinimality.java
r30725 r30737 28 28 private final ArrayList<Channel> OrEx; 29 29 private final int n; 30 private final List<List<Object>> L = new ArrayList< List<Object>>(); //The list of columns to be sorted30 private final List<List<Object>> L = new ArrayList<>(); //The list of columns to be sorted 31 31 private long EEovern = 0; 32 private final HashSet<Channel> subgraph = new HashSet< Channel>();//The candidate subgraph to be tested32 private final HashSet<Channel> subgraph = new HashSet<>();//The candidate subgraph to be tested 33 33 private ProgressMonitor pm; 34 34 private final boolean pmenabled; 35 private final ArrayList<HashSet<Channel>> junctions = new ArrayList< HashSet<Channel>>();35 private final ArrayList<HashSet<Channel>> junctions = new ArrayList<>(); 36 36 private final boolean searchFirstJunction; 37 private final ArrayList<Channel> subJunction = new ArrayList< Channel>();37 private final ArrayList<Channel> subJunction = new ArrayList<>(); 38 38 private final JPrepare jprepare; 39 39 private boolean Check = false; … … 92 92 do { 93 93 int missing = 0; 94 C = new ArrayList< Object>(3);94 C = new ArrayList<>(3); 95 95 v = new int[n][2]; 96 96 C.add(i);//the first position of column variable C is the column index … … 133 133 Iterator<List<Object>> l = L.listIterator(); 134 134 List<Object> C; 135 ArrayList<int[]> CandidateK = new ArrayList< int[]>(n*n); //saves the candidate K_{n-1} in entry-exit pairs135 ArrayList<int[]> CandidateK = new ArrayList<>(n*n); //saves the candidate K_{n-1} in entry-exit pairs 136 136 long lindex= 0; 137 137 int h = 0; … … 229 229 } 230 230 } 231 jprepare.jPrepare(new ArrayList< Channel>(subgraph));231 jprepare.jPrepare(new ArrayList<>(subgraph)); 232 232 JCheck jCheck = new JCheck(); 233 233 Check = jCheck.jCheck(jprepare.getEntries(), jprepare.getExits(), n); … … 253 253 } 254 254 if (isin == false) { 255 junctions.add(new HashSet< Channel>(subgraph));255 junctions.add(new HashSet<>(subgraph)); 256 256 //log.info("Kreuzungskandidat der Liste zugefügt" + junctions.size()); 257 257 } … … 267 267 */ 268 268 public ArrayList<Channel> getSubJunctionCandidate(){ 269 return new ArrayList< Channel>(subgraph);269 return new ArrayList<>(subgraph); 270 270 } 271 271 -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JPrepare.java
r30725 r30737 17 17 18 18 public JPrepare(ChannelDiGraph digraph) { 19 entries = new ArrayList< Channel>();20 exits = new ArrayList< Channel>();19 entries = new ArrayList<>(); 20 exits = new ArrayList<>(); 21 21 this.digraph = digraph; 22 22 } -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JunctionChecker.java
r30725 r30737 33 33 private JMinimality m; 34 34 // Variable wird beim KreuzungsSuchen benutzt, sonst ist sie leer! 35 private ArrayList<HashSet<Channel>> junctions = new ArrayList< HashSet<Channel>>();35 private ArrayList<HashSet<Channel>> junctions = new ArrayList<>(); 36 36 //dient zur Zeitmessung 37 37 private long startIterate = 0; … … 44 44 this.n = n; 45 45 this.jCheck = new JCheck(); 46 this.subjunction = new ArrayList< Channel>();46 this.subjunction = new ArrayList<>(); 47 47 smallerJunction = false; 48 48 } … … 138 138 139 139 private void collectECandidates(ArrayList<Channel> subgraph) { 140 E = new ArrayList< Channel>();140 E = new ArrayList<>(); 141 141 for (int i = 0; i < subgraph.size(); i++) { 142 142 if ((subgraph.get(i).getIndegree() + subgraph.get(i).getOutdegree() >= 3) -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/TRDFS.java
r30725 r30737 26 26 this.vertices = adnodes; 27 27 this.digraph = digraph; 28 this.cycleEdges = new ArrayList< LeadsTo>();28 this.cycleEdges = new ArrayList<>(); 29 29 } 30 30 -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/reader/ColorSchemeXMLReader.java
r30725 r30737 31 31 @Override 32 32 public void parseXML() { 33 colorScheme = new HashMap< String, Color>();33 colorScheme = new HashMap<>(); 34 34 String tempValue; 35 35 //String tempKeyValue =""; -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/reader/OSMXMLReader.java
r30725 r30737 82 82 OSMWay way = new OSMWay(); 83 83 OSMRelation relation = new OSMRelation(); 84 HashMap<String, String> hashmap = new HashMap< String, String>();84 HashMap<String, String> hashmap = new HashMap<>(); 85 85 try { 86 86 while (parser.hasNext()) { … … 92 92 if (xmlelement.equals("node")) { 93 93 node = new OSMNode(); 94 hashmap = new HashMap< String, String>();94 hashmap = new HashMap<>(); 95 95 readAttributes(node); 96 96 node.setLatitude(Double.parseDouble(parser … … 102 102 if (xmlelement.equals("way")) { 103 103 way = new OSMWay(); 104 hashmap = new HashMap< String, String>();104 hashmap = new HashMap<>(); 105 105 readAttributes(way); 106 106 } … … 108 108 if (xmlelement.equals("relation")) { 109 109 relation = new OSMRelation(); 110 hashmap = new HashMap< String, String>();110 hashmap = new HashMap<>(); 111 111 readAttributes(relation); 112 112 } … … 139 139 if (xmlelement.equals("relation")) { 140 140 relation = new OSMRelation(); 141 hashmap = new HashMap< String, String>();141 hashmap = new HashMap<>(); 142 142 readAttributes(relation); 143 143 } -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/reader/XMLFilterReader.java
r30725 r30737 16 16 public XMLFilterReader(String filename) { 17 17 super(filename); 18 filters = new Vector< Filter>();18 filters = new Vector<>(); 19 19 } 20 20 -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/util/RelationProducer.java
r30725 r30737 24 24 public RelationProducer(JunctionCheckerPlugin plugin) { 25 25 this.plugin = plugin; 26 storedRelations = new HashSet< HashSet<Channel>>();26 storedRelations = new HashSet<>(); 27 27 } 28 28 … … 31 31 return; 32 32 } 33 LinkedList<OsmPrimitive> ways = new LinkedList< OsmPrimitive>();33 LinkedList<OsmPrimitive> ways = new LinkedList<>(); 34 34 Iterator<Channel> cit = subset.iterator(); 35 35 while (cit.hasNext()) {
Note:
See TracChangeset
for help on using the changeset viewer.