link start!
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.TextUtil
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import javax.baja.collection.BICollection;
|
||||
import javax.baja.collection.BITable;
|
||||
import javax.baja.collection.Column;
|
||||
import javax.baja.collection.ColumnList;
|
||||
import javax.baja.naming.BOrdScheme;
|
||||
import javax.baja.naming.OrdQuery;
|
||||
import javax.baja.naming.OrdTarget;
|
||||
import javax.baja.naming.SyntaxException;
|
||||
import javax.baja.naming.UnresolvedException;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BCellScheme
|
||||
extends BOrdScheme {
|
||||
public static final BCellScheme INSTANCE = new BCellScheme();
|
||||
public static final Type TYPE;
|
||||
private static final Lexicon lex;
|
||||
private static final String KEY_PARAM_EXCEPTION = "cellscheme.incorrectparameters";
|
||||
private static final String KEY_UNDEFINED_COL = "cellscheme.undefinedcolumn";
|
||||
private static final String CELL_SCHEME = "cell";
|
||||
static /* synthetic */ Class class$com$tridium$collection$BCellScheme;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
|
||||
String string = ordQuery.getBody();
|
||||
BObject bObject = ordTarget.get();
|
||||
if (bObject instanceof BICollection) {
|
||||
String[] stringArray = TextUtil.split((String)string, (char)',');
|
||||
if (stringArray.length == 2) {
|
||||
BICollection bICollection = (BICollection)((Object)bObject);
|
||||
BITable bITable = bICollection.toTable();
|
||||
ColumnList columnList = bITable.getColumns();
|
||||
Column column = null;
|
||||
int n = 0;
|
||||
try {
|
||||
int n2 = Integer.parseInt(stringArray[0]);
|
||||
column = columnList.get(n2);
|
||||
}
|
||||
catch (NumberFormatException numberFormatException) {
|
||||
column = columnList.get(stringArray[0]);
|
||||
}
|
||||
try {
|
||||
n = Integer.parseInt(stringArray[1]);
|
||||
}
|
||||
catch (NumberFormatException numberFormatException) {
|
||||
n = bITable.size() - 1;
|
||||
}
|
||||
if (column == null) {
|
||||
throw new UnresolvedException(lex.getText(KEY_UNDEFINED_COL, new Object[]{stringArray[0]}));
|
||||
}
|
||||
bObject = bITable.get(n, column);
|
||||
} else {
|
||||
throw new SyntaxException(lex.getText(KEY_PARAM_EXCEPTION, new Object[]{string}));
|
||||
}
|
||||
}
|
||||
return new OrdTarget(ordTarget, bObject);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
public BCellScheme() {
|
||||
super(CELL_SCHEME);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$collection$BCellScheme;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$collection$BCellScheme = BCellScheme.class("[Lcom.tridium.collection.BCellScheme;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
Class clazz2 = class$com$tridium$collection$BCellScheme;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$com$tridium$collection$BCellScheme = BCellScheme.class("[Lcom.tridium.collection.BCellScheme;", false);
|
||||
}
|
||||
lex = Lexicon.make(clazz2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
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.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.IFilter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BEmptyTable
|
||||
extends BObject
|
||||
implements BITable {
|
||||
private static final BObject[] EMPTY_ARRAY = new BObject[0];
|
||||
private static final ColumnList NO_COLUMNS = new EmptyColumnList();
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$collection$BEmptyTable;
|
||||
|
||||
public Cursor cursor() {
|
||||
return new EmptyCursor(null);
|
||||
}
|
||||
|
||||
public BICollection filter(IFilter iFilter) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BIList toList() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BObject get(int n) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BObject[] list() {
|
||||
return EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
public BObject[] list(BObject[] bObjectArray) {
|
||||
if (bObjectArray == null) {
|
||||
return EMPTY_ARRAY;
|
||||
}
|
||||
if (bObjectArray.length == 0) {
|
||||
return bObjectArray;
|
||||
}
|
||||
return (BObject[])Array.newInstance(bObjectArray.getClass().getComponentType(), 0);
|
||||
}
|
||||
|
||||
public BITable toTable() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ColumnList getColumns() {
|
||||
return NO_COLUMNS;
|
||||
}
|
||||
|
||||
public BObject get(int n, Column column) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getString(int n, Column column) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public float getFloat(int n, Column column) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public double getDouble(int n, Column column) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public int getInt(int n, Column column) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getLong(int n, Column column) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public boolean getBoolean(int n, Column column) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getFlags(int n, Column column) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BFacets getFacets(int n, Column column) {
|
||||
return BFacets.NULL;
|
||||
}
|
||||
|
||||
public BFacets getTableFacets() {
|
||||
return BFacets.NULL;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$collection$BEmptyTable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$collection$BEmptyTable = BEmptyTable.class("[Lcom.tridium.collection.BEmptyTable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
|
||||
private static class EmptyCursor
|
||||
implements Cursor {
|
||||
Context context;
|
||||
|
||||
public Context getContext() {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public EmptyCursor(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
}
|
||||
|
||||
private static class EmptyColumnList
|
||||
implements ColumnList {
|
||||
public int size() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Column get(int n) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Column get(String string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int indexOf(String string) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public Column[] list() {
|
||||
return new Column[0];
|
||||
}
|
||||
|
||||
private EmptyColumnList() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import com.tridium.collection.BISortableTable;
|
||||
import com.tridium.collection.GenericColumn;
|
||||
import com.tridium.collection.GenericColumnList;
|
||||
import com.tridium.collection.GenericCursor;
|
||||
import com.tridium.util.ClassUtil;
|
||||
import java.util.Comparator;
|
||||
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.BBoolean;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BNumber;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Cursor;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.Array;
|
||||
import javax.baja.util.IFilter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BGenericTable
|
||||
extends BObject
|
||||
implements BISortableTable {
|
||||
public static final Type TYPE;
|
||||
BComponent[] comps;
|
||||
private GenericColumnList columns;
|
||||
static /* synthetic */ Class class$com$tridium$collection$BGenericTable;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public Cursor cursor() {
|
||||
return new GenericCursor(this);
|
||||
}
|
||||
|
||||
public BICollection filter(IFilter iFilter) {
|
||||
return new BGenericTable((BComponent[])new Array(this.comps).filter(iFilter).trim(), this.columns);
|
||||
}
|
||||
|
||||
public BIList toList() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.comps.length;
|
||||
}
|
||||
|
||||
public BObject get(int n) {
|
||||
return this.comps[n];
|
||||
}
|
||||
|
||||
public BObject[] list() {
|
||||
BObject[] bObjectArray = new BComponent[this.comps.length];
|
||||
System.arraycopy(this.comps, 0, bObjectArray, 0, this.comps.length);
|
||||
return bObjectArray;
|
||||
}
|
||||
|
||||
public BObject[] list(BObject[] bObjectArray) {
|
||||
return this.list();
|
||||
}
|
||||
|
||||
public BITable toTable() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ColumnList getColumns() {
|
||||
return this.columns;
|
||||
}
|
||||
|
||||
public BObject get(int n, Column column) {
|
||||
return this.comps[n].get(column.getName());
|
||||
}
|
||||
|
||||
public String getString(int n, Column column) {
|
||||
return this.comps[n].get(column.getName()).toString();
|
||||
}
|
||||
|
||||
public double getDouble(int n, Column column) {
|
||||
return this.number(n, column).getDouble();
|
||||
}
|
||||
|
||||
public float getFloat(int n, Column column) {
|
||||
return this.number(n, column).getFloat();
|
||||
}
|
||||
|
||||
public int getInt(int n, Column column) {
|
||||
return this.number(n, column).getInt();
|
||||
}
|
||||
|
||||
public long getLong(int n, Column column) {
|
||||
return this.number(n, column).getLong();
|
||||
}
|
||||
|
||||
public boolean getBoolean(int n, Column column) {
|
||||
return this.bool(n, column).getBoolean();
|
||||
}
|
||||
|
||||
public int getFlags(int n, Column column) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BFacets getFacets(int n, Column column) {
|
||||
return BFacets.NULL;
|
||||
}
|
||||
|
||||
public BFacets getTableFacets() {
|
||||
return BFacets.NULL;
|
||||
}
|
||||
|
||||
public BITable sort(Column column, boolean bl) {
|
||||
if (this.comps.length == 0) {
|
||||
return this;
|
||||
}
|
||||
return new BGenericTable((BComponent[])new Array(this.comps).sort(new GenericTableComparator(column, bl)).trim(), this.columns);
|
||||
}
|
||||
|
||||
private final BNumber number(int n, Column column) {
|
||||
return (BNumber)this.comps[n].get(column.getName());
|
||||
}
|
||||
|
||||
private final BBoolean bool(int n, Column column) {
|
||||
return (BBoolean)this.comps[n].get(column.getName());
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
public BGenericTable(BComponent[] bComponentArray, GenericColumnList genericColumnList) {
|
||||
if (bComponentArray.length > 0 && !ClassUtil.sameClass(bComponentArray)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.comps = bComponentArray;
|
||||
this.columns = genericColumnList;
|
||||
}
|
||||
|
||||
public BGenericTable(BComponent[] bComponentArray) {
|
||||
if (bComponentArray.length > 0 && !ClassUtil.sameClass(bComponentArray)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.comps = bComponentArray;
|
||||
this.columns = new GenericColumnList(bComponentArray);
|
||||
}
|
||||
|
||||
public BGenericTable() {
|
||||
this.comps = new BComponent[0];
|
||||
this.columns = new GenericColumnList(new GenericColumn[0]);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$collection$BGenericTable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$collection$BGenericTable = BGenericTable.class("[Lcom.tridium.collection.BGenericTable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class GenericTableComparator
|
||||
implements Comparator {
|
||||
private Column col;
|
||||
private boolean ascending;
|
||||
|
||||
public int compare(Object object, Object object2) {
|
||||
BComponent bComponent = (BComponent)object;
|
||||
BComponent bComponent2 = (BComponent)object2;
|
||||
BValue bValue = bComponent.get(this.col.getName());
|
||||
BValue bValue2 = bComponent2.get(this.col.getName());
|
||||
if (bValue instanceof Comparable) {
|
||||
return this.ascending ? ((Comparable)((Object)bValue)).compareTo(bValue2) : -((Comparable)((Object)bValue)).compareTo(bValue2);
|
||||
}
|
||||
return this.ascending ? bValue.toString().compareTo(bValue2.toString()) : -bValue.toString().compareTo(bValue2.toString());
|
||||
}
|
||||
|
||||
private GenericTableComparator(Column column, boolean bl) {
|
||||
this.col = column;
|
||||
this.ascending = bl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import javax.baja.collection.BITable;
|
||||
import javax.baja.collection.Column;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
public interface BISortableTable
|
||||
extends BITable {
|
||||
public static final Type TYPE;
|
||||
|
||||
public BITable sort(Column var1, boolean var2);
|
||||
|
||||
static {
|
||||
Class clazz = 1.class$com$tridium$collection$BISortableTable;
|
||||
if (clazz == null) {
|
||||
clazz = 1.class$com$tridium$collection$BISortableTable = 1.class("[Lcom.tridium.collection.BISortableTable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import javax.baja.collection.Column;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
public class GenericColumn
|
||||
implements Column {
|
||||
private String name;
|
||||
private String dispName;
|
||||
private Type type;
|
||||
private int flags;
|
||||
private BFacets facets;
|
||||
|
||||
public String getDisplayName(Context context) {
|
||||
return this.dispName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public int getFlags() {
|
||||
return this.flags;
|
||||
}
|
||||
|
||||
public BFacets getFacets() {
|
||||
return this.facets;
|
||||
}
|
||||
|
||||
public GenericColumn(String string, String string2, Type type) {
|
||||
this(string, string2, type, 0, BFacets.NULL);
|
||||
}
|
||||
|
||||
public GenericColumn(String string, String string2, Type type, int n, BFacets bFacets) {
|
||||
this.name = string;
|
||||
this.dispName = string2;
|
||||
this.type = type;
|
||||
this.flags = n;
|
||||
this.facets = bFacets;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import com.tridium.collection.GenericColumn;
|
||||
import com.tridium.util.ClassUtil;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.baja.collection.Column;
|
||||
import javax.baja.collection.ColumnList;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class GenericColumnList
|
||||
implements ColumnList {
|
||||
private GenericColumn[] columns;
|
||||
private Map getHash;
|
||||
private Map idxHash;
|
||||
|
||||
public int size() {
|
||||
return this.columns.length;
|
||||
}
|
||||
|
||||
public Column get(int n) {
|
||||
return this.columns[n];
|
||||
}
|
||||
|
||||
public Column get(String string) {
|
||||
return (Column)this.getHash.get(string);
|
||||
}
|
||||
|
||||
public int indexOf(String string) {
|
||||
Integer n = (Integer)this.idxHash.get(string);
|
||||
return n == null ? -1 : n;
|
||||
}
|
||||
|
||||
public Column[] list() {
|
||||
return this.columns;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.getHash = new HashMap();
|
||||
this.idxHash = new HashMap();
|
||||
}
|
||||
|
||||
public GenericColumnList(GenericColumn[] genericColumnArray) {
|
||||
this.this();
|
||||
this.columns = genericColumnArray;
|
||||
int n = 0;
|
||||
while (n < genericColumnArray.length) {
|
||||
String string = genericColumnArray[n].getName();
|
||||
this.getHash.put(string, genericColumnArray[n]);
|
||||
this.idxHash.put(string, new Integer(n));
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public GenericColumnList(BComponent[] bComponentArray) {
|
||||
this.this();
|
||||
if (bComponentArray.length > 0 && !ClassUtil.sameClass(bComponentArray)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (bComponentArray.length == 0) {
|
||||
this.columns = new GenericColumn[0];
|
||||
} else {
|
||||
BComponent bComponent = bComponentArray[0];
|
||||
Property[] propertyArray = bComponent.getPropertiesArray();
|
||||
int n = propertyArray.length;
|
||||
String[] stringArray = new String[n];
|
||||
String[] stringArray2 = new String[n];
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
stringArray[n2] = propertyArray[n2].getName();
|
||||
stringArray2[n2] = bComponent.getDisplayName(propertyArray[n2], null);
|
||||
++n2;
|
||||
}
|
||||
Type[] typeArray = new Type[n];
|
||||
int n3 = 0;
|
||||
while (n3 < n) {
|
||||
typeArray[n3] = propertyArray[n3].getType();
|
||||
++n3;
|
||||
}
|
||||
this.columns = new GenericColumn[n];
|
||||
n3 = 0;
|
||||
while (n3 < n) {
|
||||
this.columns[n3] = new GenericColumn(stringArray[n3], stringArray2[n3], typeArray[n3]);
|
||||
this.getHash.put(stringArray[n3], this.columns[n3]);
|
||||
this.idxHash.put(stringArray[n3], new Integer(n3));
|
||||
++n3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.collection;
|
||||
|
||||
import com.tridium.collection.BGenericTable;
|
||||
import javax.baja.collection.BITable;
|
||||
import javax.baja.collection.Column;
|
||||
import javax.baja.collection.TableCursor;
|
||||
import javax.baja.sys.BBoolean;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BNumber;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
class GenericCursor
|
||||
implements TableCursor {
|
||||
private BGenericTable table;
|
||||
private BComponent[] comps;
|
||||
private int idx;
|
||||
|
||||
public Context getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
boolean bl = false;
|
||||
if (++this.idx < this.comps.length) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
return this.next();
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
return this.comps[this.idx];
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
++this.idx;
|
||||
while (this.idx < this.comps.length && !clazz.isAssignableFrom(this.comps[this.idx].getClass())) {
|
||||
++this.idx;
|
||||
}
|
||||
boolean bl = false;
|
||||
if (this.idx < this.comps.length) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public BITable getTable() {
|
||||
return this.table;
|
||||
}
|
||||
|
||||
public BObject get(Column column) {
|
||||
return this.comps[this.idx].get(column.getName());
|
||||
}
|
||||
|
||||
public String getString(Column column) {
|
||||
return this.comps[this.idx].get(column.getName()).toString();
|
||||
}
|
||||
|
||||
public double getDouble(Column column) {
|
||||
return this.number(this.idx, column).getDouble();
|
||||
}
|
||||
|
||||
public float getFloat(Column column) {
|
||||
return this.number(this.idx, column).getFloat();
|
||||
}
|
||||
|
||||
public int getInt(Column column) {
|
||||
return this.number(this.idx, column).getInt();
|
||||
}
|
||||
|
||||
public long getLong(Column column) {
|
||||
return this.number(this.idx, column).getLong();
|
||||
}
|
||||
|
||||
public boolean getBoolean(Column column) {
|
||||
return this.bool(this.idx, column).getBoolean();
|
||||
}
|
||||
|
||||
public int getFlags(Column column) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BFacets getFacets(Column column) {
|
||||
return BFacets.NULL;
|
||||
}
|
||||
|
||||
private final BNumber number(int n, Column column) {
|
||||
return (BNumber)this.comps[n].get(column.getName());
|
||||
}
|
||||
|
||||
private final BBoolean bool(int n, Column column) {
|
||||
return (BBoolean)this.comps[n].get(column.getName());
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.idx = -1;
|
||||
}
|
||||
|
||||
GenericCursor(BGenericTable bGenericTable) {
|
||||
this.this();
|
||||
this.table = bGenericTable;
|
||||
this.comps = bGenericTable.comps;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user