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:
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 DATE = 4;
|
||||
int LONG = 5;
|
||||
int FLOAT = 6;
|
||||
int TEXT_POSITION = 10;
|
||||
}
|
||||
|
||||
|
@ -52,6 +53,25 @@ public abstract class ApiObject implements Parcelable {
|
|||
parcel.writeInt(Value);
|
||||
}
|
||||
}
|
||||
|
||||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue