/* * Decompiled with CFR 0.152. * * Could not load the following classes: * javax.baja.sys.BObject * javax.baja.sys.Context * javax.baja.sys.Cursor */ package com.tridium.alarm; import com.tridium.alarm.AlarmInput; import javax.baja.alarm.BAlarmRecord; import javax.baja.sys.BObject; import javax.baja.sys.Context; import javax.baja.sys.Cursor; /* * Illegal identifiers - consider using --renameillegalidents true */ public class AlarmInputCursor implements Cursor { private Context cx; private AlarmInput in; private boolean init; private BAlarmRecord rec; private boolean closeOnComplete; static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; public void setCloseOnComplete(boolean bl) { this.closeOnComplete = bl; } public Context getContext() { return this.cx; } public BObject get() { if (this.init) { throw new IllegalStateException("get() before next()"); } return this.rec; } public boolean next() { this.init = false; try { this.rec = this.in.read(); } catch (Exception exception) {} if (this.closeOnComplete && this.rec == null) { this.in.close(); } boolean bl = false; if (this.rec != null) { bl = true; } return bl; } public boolean nextComponent() { if (this.closeOnComplete) { this.in.close(); } return false; } public boolean next(Class clazz) { Class clazz2 = class$javax$baja$alarm$BAlarmRecord; if (clazz2 == null) { clazz2 = class$javax$baja$alarm$BAlarmRecord = AlarmInputCursor.class("[Ljavax.baja.alarm.BAlarmRecord;", false); } if (clazz2.isAssignableFrom(clazz)) { return this.next(); } if (this.closeOnComplete) { this.in.close(); } return false; } static /* synthetic */ Class class(String string, boolean bl) { try { Class clazz = Class.forName(string); if (!bl) { clazz = clazz.getComponentType(); } return clazz; } catch (ClassNotFoundException classNotFoundException) { throw new NoClassDefFoundError(classNotFoundException.getMessage()); } } private final /* synthetic */ void this() { this.init = true; this.closeOnComplete = true; } public AlarmInputCursor(AlarmInput alarmInput, Context context) { this.this(); this.in = alarmInput; this.cx = context; } }