Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/DijkstraSP.java

    r28298 r30737  
    4646
    4747        // relax vertices in order of distance from s
    48         pq = new IndexMinPQ<Double>(G.V());
     48        pq = new IndexMinPQ<>(G.V());
    4949        pq.insert(s, distTo[s]);
    5050        int count = 0;
     
    8686    public Iterable<DirectedEdge> pathTo(int v) {
    8787        if (!hasPathTo(v)) return null;
    88         Stack<DirectedEdge> path = new Stack<DirectedEdge>();
     88        Stack<DirectedEdge> path = new Stack<>();
    8989        for (DirectedEdge e = edgeTo[v]; e != null; e = edgeTo[e.from()]) {
    9090            path.push(e);
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java

    r30532 r30737  
    3636        adj = (Bag<DirectedEdge>[]) new Bag[V];
    3737        for (int v = 0; v < V; v++)
    38             adj[v] = new Bag<DirectedEdge>();
     38            adj[v] = new Bag<>();
    3939    }
    4040
     
    7676        for (int v = 0; v < G.V(); v++) {
    7777            // reverse so that adjacency list is in same order as original
    78             Stack<DirectedEdge> reverse = new Stack<DirectedEdge>();
     78            Stack<DirectedEdge> reverse = new Stack<>();
    7979            for (DirectedEdge e : G.adj[v]) {
    8080                reverse.push(e);
     
    124124     */
    125125    public Iterable<DirectedEdge> edges() {
    126         Bag<DirectedEdge> list = new Bag<DirectedEdge>();
     126        Bag<DirectedEdge> list = new Bag<>();
    127127        for (int v = 0; v < V; v++) {
    128128            for (DirectedEdge e : adj(v)) {
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java

    r30532 r30737  
    174174        // takes linear time since already in heap order so no keys move
    175175        public HeapIterator() {
    176             copy = new IndexMinPQ<Key>(pq.length - 1);
     176            copy = new IndexMinPQ<>(pq.length - 1);
    177177            for (int i = 1; i <= N; i++)
    178178                copy.insert(pq[i], keys[pq[i]]);
Note: See TracChangeset for help on using the changeset viewer.