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

82 lines
1.9 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package com.tridium.util;
import java.util.Iterator;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BFloat;
import javax.baja.sys.BInteger;
import javax.baja.sys.BObject;
import javax.baja.sys.BString;
import javax.baja.sys.Context;
import javax.baja.sys.Cursor;
public class IteratorCursor
implements Cursor {
private BObject target;
private Iterator values;
private BObject current;
private Context context;
public Context getContext() {
return this.context;
}
public BObject target() {
return this.target;
}
public boolean next() {
if (this.values.hasNext()) {
this.current = (BObject)this.values.next();
return true;
}
this.current = null;
return false;
}
public boolean nextObject() {
while (this.next()) {
if (this.current instanceof BBoolean || this.current instanceof BInteger || this.current instanceof BFloat || this.current instanceof BString) continue;
return true;
}
return false;
}
public boolean nextComponent() {
while (this.next()) {
if (!this.current.isComponent()) continue;
return true;
}
return false;
}
public boolean next(Class clazz) {
while (this.next()) {
if (!clazz.isInstance(this.current)) continue;
return true;
}
return false;
}
public final BObject get() {
return this.getValue(this.current);
}
protected BObject getValue(BObject bObject) {
return bObject;
}
public IteratorCursor(BObject bObject, Iterator iterator) {
this(bObject, iterator, null);
}
public IteratorCursor(BObject bObject, Iterator iterator, Context context) {
this.target = bObject;
this.values = iterator;
this.context = context;
}
}