ws连接出错,只有查看log才能正常运行的情况修改
parent
2e05f00cdf
commit
bce04b6899
@ -1 +1 @@
|
||||
{"args":["127.0.0.1"],"argsString":"127.0.0.1","cpuProp":0,"cpuTime":0,"enable":false,"name":"ping","path":"","permanentlyDelete":false,"port":10,"ramProp":0,"reNumber":0,"script":"ping ","sessionNumber":0,"type":2}
|
||||
{"args":["127.0.0.1"],"argsString":"127.0.0.1","cpuProp":0,"cpuTime":0,"enable":true,"name":"ping","path":"","permanentlyDelete":false,"port":10,"ramProp":0,"reNumber":0,"script":"ping ","sessionNumber":0,"type":2}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.leaper.pm2java.entity;
|
||||
|
||||
public class CircularList<T> {
|
||||
private Node head; // 头结点
|
||||
private int size; // 当前大小
|
||||
|
||||
private class Node {
|
||||
private T value; // 当前节点值
|
||||
private Node next; // 下一个节点
|
||||
|
||||
public Node(T value) {
|
||||
this.value = value;
|
||||
next = null;
|
||||
}
|
||||
}
|
||||
|
||||
public CircularList() {
|
||||
head = null;
|
||||
size = 150;
|
||||
}
|
||||
|
||||
public void add(T value) {
|
||||
Node newNode = new Node(value);
|
||||
if (isFull()) {
|
||||
head = newNode;
|
||||
} else {
|
||||
newNode.next = head;
|
||||
head = newNode;
|
||||
}
|
||||
size++;
|
||||
}
|
||||
|
||||
public T get(int index) {
|
||||
if (index < 0 || index >= size) {
|
||||
throw new IndexOutOfBoundsException("Index out of range");
|
||||
}
|
||||
Node current = head;
|
||||
for (int i = 0; i < index; i++) {
|
||||
current = current.next;
|
||||
}
|
||||
return current.value;
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
return size == Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue