android.os.Parcel.readDouble()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中android.os.Parcel.readDouble()方法的一些代码示例,展示了Parcel.readDouble()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parcel.readDouble()方法的具体详情如下:
包路径:android.os.Parcel
类名称:Parcel
方法名:readDouble

Parcel.readDouble介绍

[英]Read a double precision floating point value from the parcel at the current dataPosition().
[中]从当前dataPosition()处的地块读取双精度浮点值。

代码示例

代码示例来源:origin: johncarl81/parceler

@Override
public Double nullSafeFromParcel(Parcel parcel) {
  return parcel.readDouble();
}

代码示例来源:origin: android-hacker/VirtualXposed

public VLocation(Parcel in) {
  latitude = in.readDouble();
  longitude = in.readDouble();
  altitude = in.readDouble();
  accuracy = in.readFloat();
  speed = in.readFloat();
  bearing = in.readFloat();
}

代码示例来源:origin: anjlab/android-inapp-billing-v3

protected SkuDetails(Parcel in)
{
  this.productId = in.readString();
  this.title = in.readString();
  this.description = in.readString();
  this.isSubscription = in.readByte() != 0;
  this.currency = in.readString();
  this.priceValue = in.readDouble();
  this.priceLong = in.readLong();
  this.priceText = in.readString();
  this.subscriptionPeriod = in.readString();
  this.subscriptionFreeTrialPeriod = in.readString();
  this.haveTrialPeriod = in.readByte() != 0;
  this.introductoryPriceValue = in.readDouble();
  this.introductoryPriceLong = in.readLong();
  this.introductoryPriceText = in.readString();
  this.introductoryPricePeriod = in.readString();
  this.haveIntroductoryPeriod = in.readByte() != 0;
  this.introductoryPriceCycles = in.readInt();
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

protected CircleItem(Parcel in) {
  this.address = in.readString();
  this.appointUserNickname = in.readString();
  this.appointUserid = in.readString();
  this.content = in.readString();
  this.createTime = in.readLong();
  this.goodjobCount = in.readInt();
  this.id = in.readString();
  this.isvalid = in.readString();
  this.latitude = in.readDouble();
  this.longitude = in.readDouble();
  this.pictures = in.readString();
  this.replyCount = in.readInt();
  this.type = in.readInt();
  this.icon = in.readString();
  this.userId = in.readString();
  this.nickName = in.readString();
  this.goodjobs = in.createTypedArrayList(FavortItem.CREATOR);
  this.replys = in.createTypedArrayList(CommentItem.CREATOR);
  this.linkImg = in.readString();
  this.linkTitle = in.readString();
  this.takeTimes = in.readInt();
}

代码示例来源:origin: AltBeacon/android-beacon-library

mIdentifiers.add(Identifier.parse(in.readString()));
mDistance = in.readDouble();
mRssi = in.readInt();
mTxPower = in.readInt();

代码示例来源:origin: jaydenxiao2016/AndroidFire

this.totalPage = in.readInt();
this.clevel = in.readString();
this.latitude = in.readDouble();
this.longitude = in.readDouble();
this.totalStars = in.readInt();
this.totalTimes = in.readInt();

代码示例来源:origin: stackoverflow.com

betrag = in.readDouble();
betrag_effected = in.readDouble();
taxType = in.readInt();
tax = in.readInt();

代码示例来源:origin: robolectric/robolectric

@Test
public void testDataPositionAfterSomeReads() {
 parcel.writeInt(1);
 parcel.writeFloat(5);
 parcel.writeDouble(37);
 parcel.setDataPosition(0);
 parcel.readInt();
 assertThat(parcel.dataPosition()).isEqualTo(4);
 parcel.readFloat();
 assertThat(parcel.dataPosition()).isEqualTo(8);
 parcel.readDouble();
 assertThat(parcel.dataPosition()).isEqualTo(16);
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testZeroCanBeCasted_4ByteTypesCanBeReadAs8Bytes() {
 parcel.writeByte((byte) 0);
 parcel.writeByte((byte) 0);
 parcel.writeInt(0);
 parcel.writeInt(0);
 parcel.writeFloat(0.0f);
 parcel.writeByteArray(new byte[0]);
 assertThat(parcel.dataSize()).named("total size").isEqualTo(24);
 parcel.setDataPosition(0);
 assertThat(parcel.readLong()).isEqualTo(0L);
 assertWithMessage("long consumes 8B").that(parcel.dataPosition()).isEqualTo(8);
 assertThat(parcel.readDouble()).isEqualTo(0.0);
 assertWithMessage("double consumes 8B").that(parcel.dataPosition()).isEqualTo(16);
 assertThat(parcel.readString()).isEqualTo("");
 assertWithMessage("empty string 8B").that(parcel.dataPosition()).isEqualTo(24);
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testMarshallAndUnmarshall() {
 parcel.writeInt(1);
 parcel.writeString("hello");
 parcel.writeDouble(25.0);
 parcel.writeFloat(1.25f);
 parcel.writeByte((byte) 0xAF);
 int oldSize = parcel.dataSize();
 parcel.setDataPosition(7);
 byte[] rawBytes = parcel.marshall();
 assertWithMessage("data position preserved").that(parcel.dataPosition()).isEqualTo(7);
 Parcel parcel2 = Parcel.obtain();
 assertInvariants(parcel2);
 parcel2.unmarshall(rawBytes, 0, rawBytes.length);
 assertThat(parcel2.dataPosition()).isEqualTo(parcel2.dataSize());
 parcel2.setDataPosition(0);
 assertThat(parcel2.dataSize()).isEqualTo(oldSize);
 assertThat(parcel2.readInt()).isEqualTo(1);
 assertThat(parcel2.readString()).isEqualTo("hello");
 assertThat(parcel2.readDouble()).isEqualTo(25.0);
 assertThat(parcel2.readFloat()).isEqualTo(1.25f);
 assertThat(parcel2.readByte()).isEqualTo((byte) 0xAF);
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testReadWriteNumbers() {
 parcel.writeInt(Integer.MIN_VALUE);
 assertThat(parcel.dataSize()).isEqualTo(4);
 parcel.writeLong(Long.MAX_VALUE);
 assertThat(parcel.dataSize()).isEqualTo(12);
 double d = 3.14159;
 parcel.writeDouble(d);
 assertThat(parcel.dataSize()).isEqualTo(20);
 float f = -6.022e23f;
 parcel.writeFloat(f);
 assertThat(parcel.dataSize()).isEqualTo(24);
 assertInvariants();
 parcel.setDataPosition(0);
 assertThat(parcel.readInt()).isEqualTo(Integer.MIN_VALUE);
 assertThat(parcel.dataPosition()).isEqualTo(4);
 assertThat(parcel.readLong()).isEqualTo(Long.MAX_VALUE);
 assertThat(parcel.dataPosition()).isEqualTo(12);
 assertThat(parcel.readDouble()).isEqualTo(d);
 assertThat(parcel.dataPosition()).isEqualTo(20);
 assertThat(parcel.readFloat()).isEqualTo(f);
 assertThat(parcel.dataPosition()).isEqualTo(24);
 assertWithMessage("read past end is valid").that(parcel.readInt()).isEqualTo(0);
 assertThat(parcel.dataPosition()).isEqualTo(24);
 assertInvariants();
}

代码示例来源:origin: robolectric/robolectric

assertThat(parcel.readFloat()).isEqualTo(0.0f);
assertThat(parcel.dataPosition()).named("end offset of readFloat zeroes").isEqualTo(20);
assertThat(parcel.readDouble()).isEqualTo(0.0d);
assertThat(parcel.dataPosition()).named("end offset of readDouble zeroes").isEqualTo(28);
assertThat(parcel.readLong()).isEqualTo(0L);

代码示例来源:origin: parse-community/Parse-SDK-Android

/**
 * Creates a new point instance from a {@link Parcel} using the given {@link ParseParcelDecoder}.
 * The decoder is currently unused, but it might be in the future, plus this is the pattern we
 * are using in parcelable classes.
 *
 * @param source  the parcel
 * @param decoder the decoder
 */
ParseGeoPoint(Parcel source, ParseParcelDecoder decoder) {
  setLatitude(source.readDouble());
  setLongitude(source.readDouble());
}

代码示例来源:origin: guoxiaoxing/phoenix

protected MediaEntity(Parcel in) {
  this.fileType = in.readInt();
  this.mimeType = in.readString();
  this.mediaName = in.readString();
  this.createTime = in.readLong();
  this.localPath = in.readString();
  this.localThumbnailPath = in.readString();
  this.duration = in.readLong();
  this.isChecked = in.readByte() != 0;
  this.position = in.readInt();
  this.number = in.readInt();
  this.width = in.readInt();
  this.height = in.readInt();
  this.size = in.readLong();
  this.latitude = in.readDouble();
  this.longitude = in.readDouble();
  this.isUploaded = in.readByte() != 0;
  this.onlinePath = in.readString();
  this.onlineThumbnailPath = in.readString();
  this.isCompressed = in.readByte() != 0;
  this.compressPath = in.readString();
  this.cutPath = in.readString();
  this.cropOffsetX = in.readInt();
  this.cropOffsetY = in.readInt();
  this.cropWidth = in.readInt();
  this.cropHeight = in.readInt();
  this.cropAspectRatio = in.readFloat();
  this.isCut = in.readByte() != 0;
  this.editPath = in.readString();
}

代码示例来源:origin: guoxiaoxing/phoenix

protected Builder(Parcel in) {
  this.fileType = in.readInt();
  this.mimeType = in.readString();
  this.mediaName = in.readString();
  this.createTime = in.readLong();
  this.localPath = in.readString();
  this.localThumbnailPath = in.readString();
  this.duration = in.readLong();
  this.isChecked = in.readByte() != 0;
  this.position = in.readInt();
  this.number = in.readInt();
  this.width = in.readInt();
  this.height = in.readInt();
  this.size = in.readLong();
  this.latitude = in.readDouble();
  this.longitude = in.readDouble();
  this.isUploaded = in.readByte() != 0;
  this.onlinePath = in.readString();
  this.onlineThumbnailPath = in.readString();
  this.isCompressed = in.readByte() != 0;
  this.compressPath = in.readString();
  this.cutPath = in.readString();
  this.cropOffsetX = in.readInt();
  this.cropOffsetY = in.readInt();
  this.cropWidth = in.readInt();
  this.cropHeight = in.readInt();
  this.cropAspectRatio = in.readFloat();
  this.isCut = in.readByte() != 0;
  this.editPath = in.readString();
}

代码示例来源:origin: stackoverflow.com

public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(type);
  dest.writeString(numberPlate);
  dest.writeString(brand);
  dest.writeDouble(pricePerHour);
  dest.writeDouble(pricePerKm);
  dest.writeString(objectId);
  dest.writeInt(photo.length());
  dest.writeByteArray(photo);
}


public void readFromParcel(Parcel in){
  this.type = in.readString();
  this.numberPlate = in.readString();
  this.brand = in.readString();
  this.pricePerHour = in.readDouble();
  this.pricePerKm = in.readDouble();
  this.objectId = in.readString();
  this.photo = new byte[in.readInt()];
  in.readByteArray(this.photo);
}

代码示例来源:origin: stackoverflow.com

render_image_url = in.readString();
small_image_url = in.readString();
price = in.readDouble();
public_url = in.readString();
images = in.readArrayList(ImageGroup.class.getClassLoader());
related = in.readArrayList(ProductInfo.class.getClassLoader());
saleprice = in.readDouble();
sizes = in.readString();
colours = in.readString();

代码示例来源:origin: limpoxe/Android-Plugin-Framework

_arg3 = data.readFloat();
double _arg4;
_arg4 = data.readDouble();
String _arg5;
_arg5 = data.readString();

代码示例来源:origin: codezjx/AndLinker

@Override
  public Double createFromParcel(Parcel in) {
    return in.readDouble();
  }
}

代码示例来源:origin: org.infobip.mobile.messaging.api/infobip-mobile-messaging-android-sdk

protected Geo(Parcel in) {
  this.triggeringLatitude = in.readDouble();
  this.triggeringLongitude = in.readDouble();
  in.readTypedList(this.areasList, Area.CREATOR);
  this.deliveryTime = in.readParcelable(DeliveryTime.class.getClassLoader());
  in.readTypedList(this.events, GeoEvent.CREATOR);
  this.expiryTime = in.readString();
  this.startTime = in.readString();
  this.campaignId = in.readString();
}

相关文章

Parcel类方法