我试着Maximum Waiting Time进入我的内心PQueue.这 Maximum Waiting Time将PQueue自动检查我是否有任何links等待Maximum Waiting Time删除它.我对我的代码进行了这项更改,但它在删除链接后正好停止了.我想PQueue根据等待时间条件删除我的所有元素.你能告诉我这里缺少什么吗?
这是我的班级:
public class MyClass {
public static PriorityQueue <LinkNodeLight> PQueue = new PriorityQueue <> ();
private static Set<String> DuplicationLinksHub = new LinkedHashSet <> ();
private static Integer IntraLinkCount = new Integer (0);
private static Integer InterLinkCount = new Integer (0);
private static Integer DuplicationLinksCount = new Integer (0);
private static Integer MaxWaitTime = new Integer (60000); // 1 M= …Run Code Online (Sandbox Code Playgroud) 我有一个简单的问题。我正在PriorityQueue我的项目中执行。我的问题是我可以PriorityQueue为Java 设置固定大小吗?