i have this class :
public class FindPath<T,N extends Path<T,N>> {
public FindPath() {
// the constructor ...
}
}
and the path interface:
public interface Path<N, P extends Path<N,P>>
extends Iterable<N>, Comparable<Path<?,?>>
where T , P and N are generic types.
i want to define a variable FindPath in another class , and call it's constructor , basically i want something like this :
public class TestD {
private FindPath <WNode,WNodePath extends Path<WNode,WNodePath>> Find_Path = new FindPath;
}
( WNode,WNodePath
are another classes i use in the generic types )
what am i doing wrong ? how to do this right ?
also another question :|| the WNodePath
class is defined like so :
public class WNodePath implements Path<WNode, WNodePath > { .. }
the path interface is Comparable
, does that mean that also WNodePath
is Comparable , which means that i can use it compareTo()
function in a priority queue ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…