290 lines
8.7 KiB
Java
290 lines
8.7 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.bql.collection.BqlColumn
|
|
* com.tridium.bql.collection.BqlColumnList
|
|
* com.tridium.bql.collection.PropertyColumn
|
|
* javax.baja.collection.BICollection
|
|
* javax.baja.collection.BIList
|
|
* javax.baja.collection.BITable
|
|
* javax.baja.collection.Column
|
|
* javax.baja.collection.ColumnList
|
|
* javax.baja.sys.BFacets
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Cursor
|
|
* javax.baja.sys.Property
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.util.IFilter
|
|
*/
|
|
package com.tridium.alarm;
|
|
|
|
import com.tridium.alarm.AlarmColumnSpec;
|
|
import com.tridium.alarm.AlarmInput;
|
|
import com.tridium.alarm.AlarmInputCursor;
|
|
import com.tridium.alarm.AlarmTableCursor;
|
|
import com.tridium.bql.collection.BqlColumn;
|
|
import com.tridium.bql.collection.BqlColumnList;
|
|
import com.tridium.bql.collection.PropertyColumn;
|
|
import java.util.ArrayList;
|
|
import javax.baja.alarm.BAlarmRecord;
|
|
import javax.baja.collection.BICollection;
|
|
import javax.baja.collection.BIList;
|
|
import javax.baja.collection.BITable;
|
|
import javax.baja.collection.Column;
|
|
import javax.baja.collection.ColumnList;
|
|
import javax.baja.sys.BFacets;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Cursor;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.IFilter;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BAlarmInputTable
|
|
extends BObject
|
|
implements BITable {
|
|
public static final Type TYPE;
|
|
private AlarmColumnSpec[] projection;
|
|
private ColumnList columns;
|
|
private AlarmInput in;
|
|
private ArrayList recs;
|
|
private boolean gotCursor;
|
|
private BFacets tableFacets;
|
|
static /* synthetic */ Class class$com$tridium$alarm$BAlarmInputTable;
|
|
static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord;
|
|
|
|
public Cursor cursor() {
|
|
Object object = null;
|
|
if (this.gotCursor && this.recs == null) {
|
|
throw new IllegalStateException("Cursor has already been used.");
|
|
}
|
|
if (!this.gotCursor) {
|
|
this.gotCursor = true;
|
|
object = new AlarmInputCursor(this.in, null);
|
|
} else {
|
|
object = new RecCursor(this.recs, null);
|
|
}
|
|
return new AlarmTableCursor(this, (Cursor)object);
|
|
}
|
|
|
|
public BIList toList() {
|
|
this.load();
|
|
return this;
|
|
}
|
|
|
|
public BITable toTable() {
|
|
this.load();
|
|
return this;
|
|
}
|
|
|
|
public BICollection filter(IFilter iFilter) {
|
|
return this;
|
|
}
|
|
|
|
public int size() {
|
|
this.load();
|
|
return this.recs.size();
|
|
}
|
|
|
|
public BObject[] list() {
|
|
this.load();
|
|
return this.recs.toArray(new BObject[this.recs.size()]);
|
|
}
|
|
|
|
public BObject[] list(BObject[] bObjectArray) {
|
|
this.load();
|
|
return this.recs.toArray(bObjectArray);
|
|
}
|
|
|
|
public BObject get(int n) {
|
|
return (BObject)this.recs.get(n);
|
|
}
|
|
|
|
public ColumnList getColumns() {
|
|
if (this.columns == null) {
|
|
if (this.projection != null) {
|
|
BqlColumn[] bqlColumnArray = new BqlColumn[this.projection.length];
|
|
int n = 0;
|
|
while (n < bqlColumnArray.length) {
|
|
BAlarmRecord bAlarmRecord = new BAlarmRecord();
|
|
bqlColumnArray[n] = new PropertyColumn(bAlarmRecord.getProperty(this.projection[n].name));
|
|
++n;
|
|
}
|
|
return new BqlColumnList((Column[])bqlColumnArray);
|
|
}
|
|
BAlarmRecord bAlarmRecord = new BAlarmRecord();
|
|
Property[] propertyArray = bAlarmRecord.getPropertiesArray();
|
|
BqlColumn[] bqlColumnArray = new BqlColumn[propertyArray.length];
|
|
int n = 0;
|
|
while (n < propertyArray.length) {
|
|
Property property = propertyArray[n];
|
|
Object var6_9 = null;
|
|
bqlColumnArray[n] = new PropertyColumn(propertyArray[n]);
|
|
++n;
|
|
}
|
|
this.columns = new BqlColumnList((Column[])bqlColumnArray);
|
|
}
|
|
return this.columns;
|
|
}
|
|
|
|
public BObject get(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).get((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public String getString(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getString((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public float getFloat(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getFloat((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public double getDouble(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getDouble((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public int getInt(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getInt((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public long getLong(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getLong((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public boolean getBoolean(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getBoolean((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public int getFlags(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getFlags((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public BFacets getFacets(int n, Column column) {
|
|
this.load();
|
|
return ((BqlColumn)column).getFacets((BObject)((BAlarmRecord)((Object)this.recs.get(n))));
|
|
}
|
|
|
|
public BFacets getTableFacets() {
|
|
return this.tableFacets;
|
|
}
|
|
|
|
private final void load() {
|
|
if (this.recs != null) {
|
|
return;
|
|
}
|
|
this.recs = new ArrayList(1000);
|
|
Cursor cursor = this.cursor();
|
|
while (cursor.next()) {
|
|
this.recs.add(cursor.get());
|
|
}
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
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.gotCursor = false;
|
|
this.tableFacets = BFacets.NULL;
|
|
}
|
|
|
|
public BAlarmInputTable(AlarmColumnSpec[] alarmColumnSpecArray, AlarmInput alarmInput) {
|
|
this.this();
|
|
this.projection = alarmColumnSpecArray;
|
|
this.in = alarmInput;
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$alarm$BAlarmInputTable;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$alarm$BAlarmInputTable = BAlarmInputTable.class("[Lcom.tridium.alarm.BAlarmInputTable;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
private class RecCursor
|
|
implements Cursor {
|
|
ArrayList recs;
|
|
Context cx;
|
|
int index;
|
|
|
|
public Context getContext() {
|
|
return this.cx;
|
|
}
|
|
|
|
public BObject get() {
|
|
if (this.index == -1) {
|
|
throw new IllegalStateException("get() before next()");
|
|
}
|
|
return (BObject)this.recs.get(this.index);
|
|
}
|
|
|
|
public boolean next() {
|
|
if (this.index == this.recs.size()) {
|
|
return false;
|
|
}
|
|
++this.index;
|
|
boolean bl = false;
|
|
if (this.index != this.recs.size()) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
|
|
public boolean nextComponent() {
|
|
this.index = this.recs.size();
|
|
return false;
|
|
}
|
|
|
|
public boolean next(Class clazz) {
|
|
Class clazz2 = class$javax$baja$alarm$BAlarmRecord;
|
|
if (clazz2 == null) {
|
|
clazz2 = class$javax$baja$alarm$BAlarmRecord = BAlarmInputTable.class("[Ljavax.baja.alarm.BAlarmRecord;", false);
|
|
}
|
|
if (clazz2.isAssignableFrom(clazz)) {
|
|
return this.next();
|
|
}
|
|
this.index = this.recs.size();
|
|
return false;
|
|
}
|
|
|
|
public RecCursor(ArrayList arrayList, Context context) {
|
|
this.recs = arrayList;
|
|
this.cx = context;
|
|
this.index = -1;
|
|
}
|
|
}
|
|
}
|
|
|