package NET.worlds.console; import java.util.Date; import java.util.Vector; class ConnectionRecord { private static Vector recordList = new Vector(); private String _who = null; private Date _startDelayTime = null; public ConnectionRecord(String who) { this._who = who; this._startDelayTime = new Date(); } public boolean isExpired(Date now) { return now.getTime() - this._startDelayTime.getTime() > 15000L; } public String getWho() { return this._who; } public static Vector getList() { return recordList; } public static synchronized boolean checkList(String w) { boolean delayed = false; int i = 0; Date now = new Date(); while (!recordList.isEmpty() && i < recordList.size()) { ConnectionRecord r = recordList.elementAt(i); if (r.isExpired(now)) { recordList.removeElementAt(i); } else { i++; if (r.getWho().equals(w)) { delayed = true; } } } return delayed; } }