111 lines
2.9 KiB
Java
111 lines
2.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.util;
|
|
|
|
import javax.baja.sys.BAbsTime;
|
|
import javax.baja.sys.BStruct;
|
|
import javax.baja.sys.BTime;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BTimeRange
|
|
extends BStruct {
|
|
public static final Property startTime = BTimeRange.newProperty(0, BTime.make(0, 0, 0, 0), null);
|
|
public static final Property endTime = BTimeRange.newProperty(0, BTime.make(0, 0, 0, 0), null);
|
|
public static final Type TYPE;
|
|
static /* synthetic */ Class class$javax$baja$util$BTimeRange;
|
|
|
|
public BTime getStartTime() {
|
|
return (BTime)this.get(startTime);
|
|
}
|
|
|
|
public void setStartTime(BTime bTime) {
|
|
this.set(startTime, (BValue)bTime, null);
|
|
}
|
|
|
|
public BTime getEndTime() {
|
|
return (BTime)this.get(endTime);
|
|
}
|
|
|
|
public void setEndTime(BTime bTime) {
|
|
this.set(endTime, (BValue)bTime, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public boolean includes(BAbsTime bAbsTime) {
|
|
return this.test(bAbsTime.getTimeOfDayMillis());
|
|
}
|
|
|
|
public boolean includes(BTime bTime) {
|
|
return this.test(bTime.getTimeOfDayMillis());
|
|
}
|
|
|
|
public boolean isAllDay() {
|
|
return this.getStartTime().equals(this.getEndTime());
|
|
}
|
|
|
|
public String toString(Context context) {
|
|
return this.getStartTime().toString(context) + " - " + this.getEndTime().toString(context);
|
|
}
|
|
|
|
private final boolean test(long l) {
|
|
long l2 = this.getStartTime().getTimeOfDayMillis();
|
|
long l3 = this.getEndTime().getTimeOfDayMillis();
|
|
if (l3 == 0L) {
|
|
l3 = 86400000L;
|
|
}
|
|
if (l2 < l3) {
|
|
boolean bl = false;
|
|
if (l >= l2 && l <= l3) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
boolean bl = false;
|
|
if (l >= l2 || l <= l3) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
|
|
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 BTimeRange() {
|
|
}
|
|
|
|
public BTimeRange(BTime bTime, BTime bTime2) {
|
|
this.setStartTime(bTime);
|
|
this.setEndTime(bTime2);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$javax$baja$util$BTimeRange;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$util$BTimeRange = BTimeRange.class("[Ljavax.baja.util.BTimeRange;", false);
|
|
}
|
|
TYPE = Sys.loadType(clazz);
|
|
}
|
|
}
|
|
|