Possible Duplicate:
When should you encapsulate generic types?
I’ve started with using Generics in java but I ran into a big problem with defining them because my code gets rapidly unreadable like in the case of:
PriorityQueue<Vertex<Integer, VertexValue, Integer, EdgeValue>> Q = new PriorityQueue<Vertex<Integer, VertexValue, Integer, EdgeValue>>(10, new AugPathPQSuperawesomeComparator());
And there are multiple instances of this piece of code.
Is there a way to make it all smaler by using something like:
V = Vertex<Integer, VertexValue, Integer, EdgeValue>
PriorityQueue<V> Q = new PriorityQueue<V>(10, new AugPathPQSuperawesomeComparator());
Something like.