Ignore:
Timestamp:
2014-07-14T04:18:06+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix compilation warnings

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

Legend:

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

    r28116 r30532  
    2121 *  <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
    2222 */
    23 
    24 
    25 
    2623public class EdgeWeightedDigraph {
    2724    private final int V;
     
    3229     * Create an empty edge-weighted digraph with V vertices.
    3330     */
     31    @SuppressWarnings("unchecked")
    3432    public EdgeWeightedDigraph(int V) {
    3533        if (V < 0) throw new RuntimeException("Number of vertices must be nonnegative");
     
    102100    }
    103101
    104 
    105102   /**
    106103     * Add the edge e to this digraph.
     
    111108        E++;
    112109    }
    113 
    114110
    115111   /**
     
    144140    }
    145141
    146 
    147 
    148142   /**
    149143     * Return a string representation of this graph.
     
    162156        return s.toString();
    163157    }
    164 
    165     /**
    166      * Test client.
    167      */
    168 //    public static void main(String[] args) {
    169 //        In in = new In(args[0]);
    170 //        EdgeWeightedDigraph G = new EdgeWeightedDigraph(in);
    171 //        StdOut.println(G);
    172 //    }
    173 
    174158}
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java

    r28116 r30532  
    1919    private Key[] keys;      // keys[i] = priority of i
    2020
     21    @SuppressWarnings("unchecked")
    2122    public IndexMinPQ(int NMAX) {
    2223        keys = (Key[]) new Comparable[NMAX + 1];    // make this of length NMAX??
     
    186187        }
    187188    }
    188 
    189 
    190 //    public static void main(String[] args) {
    191 //        // insert a bunch of strings
    192 //        String[] strings = { "it", "was", "the", "best", "of", "times", "it", "was", "the", "worst" };
    193 //
    194 //        IndexMinPQ<String> pq = new IndexMinPQ<String>(strings.length);
    195 //        for (int i = 0; i < strings.length; i++) {
    196 //            pq.insert(i, strings[i]);
    197 //        }
    198 //
    199 //        // delete and print each key
    200 //        while (!pq.isEmpty()) {
    201 //            int i = pq.delMin();
    202 //            StdOut.println(i + " " + strings[i]);
    203 //        }
    204 //        StdOut.println();
    205 //
    206 //        // reinsert the same strings
    207 //        for (int i = 0; i < strings.length; i++) {
    208 //            pq.insert(i, strings[i]);
    209 //        }
    210 //
    211 //        // print each key using the iterator
    212 //        for (int i : pq) {
    213 //            StdOut.println(i + " " + strings[i]);
    214 //        }
    215 //        while (!pq.isEmpty()) {
    216 //            pq.delMin();
    217 //        }
    218 //
    219 //    }
    220189}
Note: See TracChangeset for help on using the changeset viewer.