100 lines
2.4 KiB
Java
100 lines
2.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package com.tridium.sys.engine;
|
|
|
|
import com.tridium.sys.schema.NSlot;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import javax.baja.sys.Action;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BValue;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public final class ActionQueue {
|
|
private Entry temp;
|
|
private HashMap map;
|
|
private Entry head;
|
|
private Entry tail;
|
|
private int peak;
|
|
|
|
public final int size() {
|
|
return this.map.size();
|
|
}
|
|
|
|
public final int peak() {
|
|
return this.peak;
|
|
}
|
|
|
|
public final void enqueue(BComponent bComponent, Action action, BValue bValue) {
|
|
this.temp.init(bComponent, action, bValue);
|
|
if (this.map.get(this.temp) != null) {
|
|
return;
|
|
}
|
|
Entry entry = this.temp;
|
|
this.temp = new Entry();
|
|
this.map.put(entry, this);
|
|
if (this.tail == null) {
|
|
this.head = this.tail = entry;
|
|
} else {
|
|
this.tail.next = entry;
|
|
this.tail = entry;
|
|
}
|
|
if (this.map.size() > this.peak) {
|
|
this.peak = this.map.size();
|
|
}
|
|
}
|
|
|
|
public final Entry reset() {
|
|
Entry entry = this.head;
|
|
this.map.clear();
|
|
this.tail = null;
|
|
this.head = null;
|
|
return entry;
|
|
}
|
|
|
|
public final Iterator iterator() {
|
|
return this.map.keySet().iterator();
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.temp = new Entry();
|
|
this.map = new HashMap();
|
|
}
|
|
|
|
public ActionQueue() {
|
|
this.this();
|
|
}
|
|
|
|
public static final class Entry {
|
|
public BComponent component;
|
|
public Action action;
|
|
public BValue arg;
|
|
public int hashCode;
|
|
public Entry next;
|
|
|
|
public final void init(BComponent bComponent, Action action, BValue bValue) {
|
|
this.component = bComponent;
|
|
this.action = action;
|
|
this.arg = bValue;
|
|
this.hashCode = bComponent.hashCode() ^ ((NSlot)((Object)action)).index;
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return this.hashCode;
|
|
}
|
|
|
|
public final boolean equals(Object object) {
|
|
Entry entry = (Entry)object;
|
|
boolean bl = false;
|
|
if (this.component == entry.component && this.action == entry.action) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
}
|
|
}
|
|
|