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

174 lines
4.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import java.util.ArrayList;
import javax.baja.naming.OrdQuery;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public final class OrdQueryList {
ArrayList list;
boolean modified;
public final int size() {
return this.list.size();
}
public final OrdQuery get(int n) {
return (OrdQuery)this.list.get(n);
}
public final OrdQuery[] toArray() {
return this.list.toArray(new OrdQuery[this.list.size()]);
}
public final OrdQuery prev(int n) {
if (n > 0 && this.list.size() > 0) {
return (OrdQuery)this.list.get(n - 1);
}
return null;
}
public final OrdQuery next(int n) {
if (n + 1 < this.list.size()) {
return (OrdQuery)this.list.get(n + 1);
}
return null;
}
public final boolean isSameScheme(int n, int n2) {
if (n >= 0 && n < this.list.size() && n2 >= 0 && n2 < this.list.size()) {
OrdQuery ordQuery = (OrdQuery)this.list.get(n);
OrdQuery ordQuery2 = (OrdQuery)this.list.get(n2);
boolean bl = false;
if (ordQuery.getClass() == ordQuery2.getClass() && ordQuery.getScheme().equals(ordQuery2.getScheme())) {
bl = true;
}
return bl;
}
return false;
}
public final void add(OrdQueryList ordQueryList) {
this.modified = true;
int n = 0;
while (n < ordQueryList.size()) {
this.add(ordQueryList.get(n));
++n;
}
}
public final void add(OrdQuery ordQuery) {
this.modified = true;
this.list.add(this.list.size(), ordQuery);
}
public final void add(int n, OrdQuery ordQuery) {
this.modified = true;
this.list.add(n, ordQuery);
}
public final void replace(int n, OrdQuery ordQuery) {
this.modified = true;
this.list.set(n, ordQuery);
}
public final void remove(int n) {
this.modified = true;
this.list.remove(n);
}
public final void clear() {
this.modified = true;
this.list.clear();
}
public final void trim(int n) {
this.trim(n, this.size());
}
public final void trim(int n, int n2) {
if (n > 0 || n2 < this.list.size()) {
this.modified = true;
int n3 = this.list.size();
int n4 = n2;
while (n4 < n3) {
this.list.remove(n2);
++n4;
}
n4 = 0;
while (n4 < n) {
this.list.remove(0);
++n4;
}
}
}
public final void merge(int n, OrdQuery ordQuery) {
this.modified = true;
this.list.remove(n + 1);
this.list.remove(n);
this.list.add(n, ordQuery);
}
public final void shiftToHost(int n) {
int n2 = n - 1;
while (n2 >= 0) {
if (!this.get(n2).isHost()) {
this.remove(n2);
}
--n2;
}
}
public final void shiftToSession(int n) {
int n2 = n - 1;
while (n2 >= 0) {
OrdQuery ordQuery = this.get(n2);
if (!ordQuery.isHost() && !ordQuery.isSession()) {
this.remove(n2);
}
--n2;
}
}
public final String toString() {
StringBuffer stringBuffer = new StringBuffer();
int n = 0;
while (n < this.list.size()) {
if (n > 0) {
stringBuffer.append('|');
}
stringBuffer.append(this.list.get(n));
++n;
}
return stringBuffer.toString();
}
private final /* synthetic */ void this() {
this.list = new ArrayList();
}
public OrdQueryList(OrdQuery[] ordQueryArray, int n) {
this.this();
this.list.ensureCapacity(n);
int n2 = 0;
while (n2 < n) {
this.list.add(ordQueryArray[n2]);
++n2;
}
}
public OrdQueryList(OrdQuery[] ordQueryArray) {
this(ordQueryArray, ordQueryArray.length);
}
public OrdQueryList() {
this.this();
}
}