1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 09:49:19 +02:00

ApiObject.Float type

This commit is contained in:
Nikolay Pultsin 2013-10-19 15:49:36 +01:00
parent f59530d2e7
commit 096a60c602

View file

@ -19,6 +19,7 @@ public abstract class ApiObject implements Parcelable {
int BOOLEAN = 3;
int DATE = 4;
int LONG = 5;
int FLOAT = 6;
int TEXT_POSITION = 10;
}
@ -53,6 +54,25 @@ public abstract class ApiObject implements Parcelable {
}
}
static class Float extends ApiObject {
final float Value;
Float(float value) {
Value = value;
}
@Override
protected int type() {
return Type.FLOAT;
}
@Override
public void writeToParcel(Parcel parcel, int flags) {
super.writeToParcel(parcel, flags);
parcel.writeFloat(Value);
}
}
static class Long extends ApiObject {
final long Value;
@ -152,6 +172,10 @@ public abstract class ApiObject implements Parcelable {
return new Integer(value);
}
static ApiObject envelope(float value) {
return new Float(value);
}
static ApiObject envelope(long value) {
return new Long(value);
}
@ -207,6 +231,8 @@ public abstract class ApiObject implements Parcelable {
return Void.Instance;
case Type.INT:
return new Integer(parcel.readInt());
case Type.FLOAT:
return new Float(parcel.readFloat());
case Type.LONG:
return new Long(parcel.readLong());
case Type.BOOLEAN: