mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
ApiObject.Float type
This commit is contained in:
parent
f59530d2e7
commit
096a60c602
1 changed files with 26 additions and 0 deletions
|
@ -19,6 +19,7 @@ public abstract class ApiObject implements Parcelable {
|
||||||
int BOOLEAN = 3;
|
int BOOLEAN = 3;
|
||||||
int DATE = 4;
|
int DATE = 4;
|
||||||
int LONG = 5;
|
int LONG = 5;
|
||||||
|
int FLOAT = 6;
|
||||||
int TEXT_POSITION = 10;
|
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 {
|
static class Long extends ApiObject {
|
||||||
final long Value;
|
final long Value;
|
||||||
|
|
||||||
|
@ -152,6 +172,10 @@ public abstract class ApiObject implements Parcelable {
|
||||||
return new Integer(value);
|
return new Integer(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ApiObject envelope(float value) {
|
||||||
|
return new Float(value);
|
||||||
|
}
|
||||||
|
|
||||||
static ApiObject envelope(long value) {
|
static ApiObject envelope(long value) {
|
||||||
return new Long(value);
|
return new Long(value);
|
||||||
}
|
}
|
||||||
|
@ -207,6 +231,8 @@ public abstract class ApiObject implements Parcelable {
|
||||||
return Void.Instance;
|
return Void.Instance;
|
||||||
case Type.INT:
|
case Type.INT:
|
||||||
return new Integer(parcel.readInt());
|
return new Integer(parcel.readInt());
|
||||||
|
case Type.FLOAT:
|
||||||
|
return new Float(parcel.readFloat());
|
||||||
case Type.LONG:
|
case Type.LONG:
|
||||||
return new Long(parcel.readLong());
|
return new Long(parcel.readLong());
|
||||||
case Type.BOOLEAN:
|
case Type.BOOLEAN:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue