153 lines
5.0 KiB
Java
153 lines
5.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.util;
|
|
|
|
import java.io.DataInput;
|
|
import java.io.DataOutput;
|
|
import java.io.IOException;
|
|
import java.util.StringTokenizer;
|
|
import javax.baja.io.BajaIOException;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.BSimple;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public final class BWsAnnotation
|
|
extends BSimple {
|
|
public static final BWsAnnotation DEFAULT = new BWsAnnotation(0, 0, 8, 0);
|
|
public static final Type TYPE;
|
|
public static final String PROPERTY_NAME = "wsAnnotation";
|
|
public final int p;
|
|
public final int q;
|
|
public final int wixelWidth;
|
|
public final int wixelHeight;
|
|
private String string;
|
|
static /* synthetic */ Class class$javax$baja$util$BWsAnnotation;
|
|
|
|
public static final BWsAnnotation make(int n, int n2) {
|
|
return new BWsAnnotation(n, n2, BWsAnnotation.DEFAULT.wixelWidth, BWsAnnotation.DEFAULT.wixelHeight);
|
|
}
|
|
|
|
public static final BWsAnnotation make(int n, int n2, int n3) {
|
|
return new BWsAnnotation(n, n2, n3, BWsAnnotation.DEFAULT.wixelHeight);
|
|
}
|
|
|
|
public static final BWsAnnotation make(int n, int n2, int n3, int n4) {
|
|
return new BWsAnnotation(n, n2, n3, n4);
|
|
}
|
|
|
|
public static final BWsAnnotation merge(BWsAnnotation bWsAnnotation, BWsAnnotation bWsAnnotation2) {
|
|
if (bWsAnnotation == null && bWsAnnotation2 == null) {
|
|
return DEFAULT;
|
|
}
|
|
if (bWsAnnotation == null) {
|
|
return bWsAnnotation2;
|
|
}
|
|
if (bWsAnnotation2 == null) {
|
|
return bWsAnnotation;
|
|
}
|
|
int n = Math.max(bWsAnnotation.wixelWidth, bWsAnnotation2.wixelWidth);
|
|
int n2 = Math.max(bWsAnnotation.wixelHeight, bWsAnnotation2.wixelHeight);
|
|
return new BWsAnnotation(bWsAnnotation2.p, bWsAnnotation2.q, n, n2);
|
|
}
|
|
|
|
public final BWsAnnotation translate(int n, int n2) {
|
|
return new BWsAnnotation(this.p + n, this.q + n2, this.wixelWidth, this.wixelHeight);
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return this.p ^ this.q ^ this.wixelWidth ^ this.wixelHeight;
|
|
}
|
|
|
|
public final boolean equals(Object object) {
|
|
if (object instanceof BWsAnnotation) {
|
|
BWsAnnotation bWsAnnotation = (BWsAnnotation)object;
|
|
if (this.p != bWsAnnotation.p) {
|
|
return false;
|
|
}
|
|
if (this.q != bWsAnnotation.q) {
|
|
return false;
|
|
}
|
|
if (this.wixelWidth != bWsAnnotation.wixelWidth) {
|
|
return false;
|
|
}
|
|
return this.wixelHeight == bWsAnnotation.wixelHeight;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final void encode(DataOutput dataOutput) throws IOException {
|
|
dataOutput.writeUTF(this.string);
|
|
}
|
|
|
|
public final BObject decode(DataInput dataInput) throws IOException {
|
|
return this.decodeFromString(dataInput.readUTF());
|
|
}
|
|
|
|
public final String encodeToString() throws IOException {
|
|
return this.string;
|
|
}
|
|
|
|
public final BObject decodeFromString(String string) throws IOException {
|
|
try {
|
|
return new BWsAnnotation(string);
|
|
}
|
|
catch (Exception exception) {
|
|
throw new BajaIOException(string, exception);
|
|
}
|
|
}
|
|
|
|
public final 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 BWsAnnotation(int n, int n2, int n3, int n4) {
|
|
this.p = n;
|
|
this.q = n2;
|
|
this.wixelWidth = n3;
|
|
this.wixelHeight = n4;
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
stringBuffer.append(n).append(',').append(n2).append(',').append(n3);
|
|
if (n4 != 0) {
|
|
stringBuffer.append(',').append(n4);
|
|
}
|
|
this.string = stringBuffer.toString();
|
|
}
|
|
|
|
private BWsAnnotation(String string) throws Exception {
|
|
StringTokenizer stringTokenizer = new StringTokenizer(string, "|");
|
|
StringTokenizer stringTokenizer2 = new StringTokenizer(stringTokenizer.nextToken(), ",");
|
|
this.p = Integer.parseInt(stringTokenizer2.nextToken());
|
|
this.q = Integer.parseInt(stringTokenizer2.nextToken());
|
|
this.wixelWidth = Integer.parseInt(stringTokenizer2.nextToken());
|
|
this.wixelHeight = stringTokenizer2.hasMoreTokens() ? Integer.parseInt(stringTokenizer2.nextToken()) : 0;
|
|
this.string = string;
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$javax$baja$util$BWsAnnotation;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$util$BWsAnnotation = BWsAnnotation.class("[Ljavax.baja.util.BWsAnnotation;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
}
|
|
}
|
|
|