2026-03-17 13:31:18 -07:00

162 lines
4.4 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package com.tridium.sys.schema;
import com.tridium.sys.schema.DynamicTable;
import com.tridium.sys.schema.NSlot;
import javax.baja.sys.Action;
import javax.baja.sys.BComplex;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Slot;
import javax.baja.sys.SlotCursor;
import javax.baja.sys.Topic;
final class SlotsCursor
implements SlotCursor {
private int index = -1;
private BComplex object;
private NSlot[] frozen;
private DynamicTable dynamic;
private int count;
public final BObject target() {
return this.object;
}
public final Context getContext() {
return null;
}
public final boolean next() {
boolean bl = false;
if (++this.index < this.count) {
bl = true;
}
return bl;
}
public final boolean nextObject() {
while (++this.index < this.count) {
block4: {
try {
Slot slot = this.slot();
if (!slot.isProperty()) continue;
if (slot.asProperty().getTypeAccess() != 7) {
}
break block4;
}
catch (RuntimeException runtimeException) {
runtimeException.printStackTrace();
}
continue;
}
return true;
}
return false;
}
public final boolean nextComponent() {
while (++this.index < this.count) {
block4: {
try {
Property property;
Slot slot = this.slot();
if (!slot.isProperty() || (property = slot.asProperty()).getTypeAccess() != 7) continue;
if (!this.object.get(property).isComponent()) {
}
break block4;
}
catch (RuntimeException runtimeException) {
runtimeException.printStackTrace();
}
continue;
}
return true;
}
return false;
}
public final boolean next(Class clazz) {
while (++this.index < this.count) {
block4: {
try {
Property property;
Slot slot = this.slot();
if (!slot.isProperty() || (property = slot.asProperty()).getTypeAccess() != 7) continue;
if (!clazz.isInstance(this.object.get(property))) {
}
break block4;
}
catch (RuntimeException runtimeException) {
runtimeException.printStackTrace();
}
continue;
}
return true;
}
return false;
}
public final Slot slot() {
if (this.index < this.frozen.length) {
return this.frozen[this.index];
}
return this.dynamic.slots[this.index - this.frozen.length];
}
public final Property property() {
return this.slot().asProperty();
}
public final int getTypeAccess() {
return this.slot().asProperty().getTypeAccess();
}
public final BObject get() {
return this.object.get(this.slot().asProperty());
}
public final boolean getBoolean() {
return this.object.getBoolean(this.slot().asProperty());
}
public final int getInt() {
return this.object.getInt(this.slot().asProperty());
}
public final long getLong() {
return this.object.getLong(this.slot().asProperty());
}
public final float getFloat() {
return this.object.getFloat(this.slot().asProperty());
}
public final double getDouble() {
return this.object.getDouble(this.slot().asProperty());
}
public final String getString() {
return this.object.getString(this.slot().asProperty());
}
public final Action action() {
return this.slot().asAction();
}
public final Topic topic() {
return this.slot().asTopic();
}
SlotsCursor(BComplex bComplex, NSlot[] nSlotArray, DynamicTable dynamicTable) {
this.object = bComplex;
this.frozen = nSlotArray;
this.dynamic = dynamicTable;
this.count = dynamicTable == null ? nSlotArray.length : nSlotArray.length + dynamicTable.count;
}
}