Changeset 36362 in osm
- Timestamp:
- 2025-01-02T14:16:53+01:00 (8 days ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/Bag.java
r32725 r36362 2 2 package edu.princeton.cs.algs4; 3 3 4 /************************************************************************* 4 /* ************************************************************************ 5 5 * Compilation: javac Bag.java 6 6 * Execution: java Bag < input.txt -
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java
r32725 r36362 103 103 * Add the edge e to this digraph. 104 104 */ 105 public void addEdge(DirectedEdge e) { 106 int v = e.from(); 107 adj[v].add(e); 105 public void addEdge(DirectedEdge ed) { 106 int v = ed.from(); 107 adj[v].add(ed); 108 108 E++; 109 109 } 110 110 111 111 /** 112 * Return the edges leaving vertex v as an Iterable. 113 * To iterate over the edges leaving vertex v, use foreach notation: 114 * <tt>for (DirectedEdge e : graph.adj(v))</tt>. 112 * Return the edges leaving vertex ve as an Iterable. 113 * To iterate over the edges leaving vertex ve, use foreach notation: 114 * <tt>for (DirectedEdge e : graph.adj(ve))</tt>. 115 115 */ 116 public Iterable<DirectedEdge> adj(int v) { 117 return adj[v]; 116 public Iterable<DirectedEdge> adj(int ve) { 117 return adj[ve]; 118 118 } 119 119 … … 125 125 public Iterable<DirectedEdge> edges() { 126 126 Bag<DirectedEdge> list = new Bag<>(); 127 for (int v = 0; v < V; v++) {128 for (DirectedEdge e : adj(v)) {129 list.add(e); 127 for (int ve = 0; ve < V; ve++) { 128 for (DirectedEdge ed : adj(ve)) { 129 list.add(ed); 130 130 } 131 131 } … … 134 134 135 135 /** 136 * Return number of edges leaving v. 136 * Return number of edges leaving ve. 137 137 */ 138 public int outdegree(int v) { 139 return adj[v].size(); 138 public int outdegree(int ve) { 139 return adj[ve].size(); 140 140 } 141 141 -
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java
r32725 r36362 2 2 package edu.princeton.cs.algs4; 3 3 4 /************************************************************************* 4 /* ************************************************************************ 5 5 * Compilation: javac IndexMinPQ.java 6 6 * Execution: java IndexMinPQ -
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/Stack.java
r32725 r36362 2 2 package edu.princeton.cs.algs4; 3 3 4 /************************************************************************* 4 /* ************************************************************************ 5 5 * Compilation: javac Stack.java 6 6 * Execution: java Stack < input.txt … … 160 160 161 161 162 /** 163 * A test client. 164 */ 162 ///** 163 // * A test client. 164 // */ 165 165 // public static void main(String[] args) { 166 166 // Stack<String> s = new Stack<String>(); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/OpenPageAction.java
r35579 r36362 7 7 import java.awt.event.ActionEvent; 8 8 import java.awt.event.KeyEvent; 9 import java.io.IOException; 9 10 import java.io.UnsupportedEncodingException; 10 11 import java.net.URLEncoder; 12 import java.net.HttpURLConnection; 13 import java.net.URL; 11 14 import java.util.Collection; 12 15 import java.util.regex.Matcher; … … 98 101 addr = addr.replace(keys[j], vals[j]); 99 102 } 103 104 // Opened on the local system instead of the browser: local:http://127.0.0.1:<port>/script 105 Pattern pat_direct = Pattern.compile("local:(http.*)$"); 106 Matcher m_direct = pat_direct.matcher(addr); 107 100 108 try { 109 if (m_direct.find()) { 110 addr = m_direct.group(1); // replace addr so possible error uses it 111 Logging.info("Opening on the local system: " + addr); 112 URL url = new URL(addr); 113 HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); 114 urlConn.setRequestMethod("GET"); 115 if (urlConn.getResponseCode() != HttpURLConnection.HTTP_OK) { 116 throw new IOException(". GET response:" + urlConn.getResponseCode()); 117 } 118 101 119 // See #12836 - do not load invalid history 102 if (!addr.endsWith("/0/history")) { 120 } else if (!addr.endsWith("/0/history")) { 103 121 OpenBrowser.displayUrl(addr); 104 122 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java
r34454 r36362 137 137 138 138 private List<String> readItemsFromTable() { 139 TableModel model = (table.getModel());139 TableModel model = table.getModel(); 140 140 String v; 141 141 ArrayList<String> lst = new ArrayList<>(); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java
r35476 r36362 347 347 } else if (m.group(7) != null) { 348 348 sb.append("x"); // cardinal direction 349 String c = m.group(7).toUpperCase(); 349 String c = m.group(7).toUpperCase(Locale.ROOT); 350 350 if ("N".equals(c) || "S".equals(c) || "E".equals(c) || "W".equals(c)) { 351 351 list.add(c); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java
r35476 r36362 80 80 if (this == obj) 81 81 return true; 82 if (!super.equals(obj) || getClass() != obj.getClass())82 if (!super.equals(obj) || !(obj instanceof ConnectedMatch)) 83 83 return false; 84 84 ConnectedMatch other = (ConnectedMatch) obj; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java
r35476 r36362 62 62 if (this == obj) 63 63 return true; 64 if (!super.equals(obj) || getClass() != obj.getClass())64 if (!super.equals(obj) || !(obj instanceof InsideMatch)) 65 65 return false; 66 66 InsideMatch other = (InsideMatch) obj; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java
r35476 r36362 70 70 if (this == obj) 71 71 return true; 72 if (!super.equals(obj) || getClass() != obj.getClass())72 if (!super.equals(obj) || !(obj instanceof IntersectingMatch)) 73 73 return false; 74 74 IntersectingMatch other = (IntersectingMatch) obj; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/RangeMatch.java
r35970 r36362 53 53 if (this == obj) 54 54 return true; 55 if ( obj == null || getClass() != obj.getClass())55 if (!(obj instanceof RangeMatch)) 56 56 return false; 57 57 RangeMatch other = (RangeMatch) obj; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java
r35613 r36362 433 433 434 434 /** 435 * Get Count of Ray intersections 435 436 * @param point - point to start an OX-parallel ray 436 437 * @param polygonPoints - poits forming bundary, use null to split unconnected segmants -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectHighwayAction.java
r35674 r36362 194 194 public List<Way> getPath(Way to) { 195 195 if (to == null) 196 return Collections.singletonList(tree.get(0)); 196 return Collections.unmodifiableList(Collections.singletonList(tree.get(0))); 197 197 int pos = tree.indexOf(to); 198 198 if (pos < 0)
Note:
See TracChangeset
for help on using the changeset viewer.