NetworkRecord.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. package de.tudarmstadt.informatik.hostage.logging;
  2. import java.io.Serializable;
  3. import android.os.Parcel;
  4. import android.os.Parcelable;
  5. public class NetworkRecord implements Parcelable, Serializable{
  6. private static final long serialVersionUID = -1586629159904177836L;
  7. private String bssid;
  8. private String ssid;
  9. private long timestampLocation;
  10. private double latitude;
  11. private double longitude;
  12. private float accuracy;
  13. public static final Parcelable.Creator<NetworkRecord> CREATOR = new Parcelable.Creator<NetworkRecord>() {
  14. @Override
  15. public NetworkRecord createFromParcel(Parcel source) {
  16. return new NetworkRecord(source);
  17. }
  18. @Override
  19. public NetworkRecord[] newArray(int size) {
  20. return new NetworkRecord[size];
  21. }
  22. };
  23. public NetworkRecord() {
  24. }
  25. public NetworkRecord(Parcel source) {
  26. this.bssid = source.readString();
  27. this.ssid = source.readString();
  28. this.timestampLocation = source.readLong();
  29. this.latitude = source.readDouble();
  30. this.longitude = source.readDouble();
  31. this.accuracy = source.readFloat();
  32. }
  33. @Override
  34. public int describeContents() {
  35. return 0;
  36. }
  37. @Override
  38. public void writeToParcel(Parcel dest, int flags) {
  39. dest.writeString(bssid);
  40. dest.writeString(ssid);
  41. dest.writeLong(timestampLocation);
  42. dest.writeDouble(latitude);
  43. dest.writeDouble(longitude);
  44. dest.writeFloat(accuracy);
  45. }
  46. /**
  47. * @return the bssid
  48. */
  49. public String getBssid() {
  50. return bssid;
  51. }
  52. /**
  53. * @param bssid the bssid to set
  54. */
  55. public void setBssid(String bssid) {
  56. this.bssid = bssid;
  57. }
  58. /**
  59. * @return the ssid
  60. */
  61. public String getSsid() {
  62. return ssid;
  63. }
  64. /**
  65. * @param ssid the ssid to set
  66. */
  67. public void setSsid(String ssid) {
  68. this.ssid = ssid;
  69. }
  70. /**
  71. * @return the timestampLocation
  72. */
  73. public long getTimestampLocation() {
  74. return timestampLocation;
  75. }
  76. /**
  77. * @param timestampLocation the timestampLocation to set
  78. */
  79. public void setTimestampLocation(long timestampLocation) {
  80. this.timestampLocation = timestampLocation;
  81. }
  82. /**
  83. * @return the latitude
  84. */
  85. public double getLatitude() {
  86. return latitude;
  87. }
  88. /**
  89. * @param latitude the latitude to set
  90. */
  91. public void setLatitude(double latitude) {
  92. this.latitude = latitude;
  93. }
  94. /**
  95. * @return the longitude
  96. */
  97. public double getLongitude() {
  98. return longitude;
  99. }
  100. /**
  101. * @param longitude the longitude to set
  102. */
  103. public void setLongitude(double longitude) {
  104. this.longitude = longitude;
  105. }
  106. /**
  107. * @return the accuracy
  108. */
  109. public float getAccuracy() {
  110. return accuracy;
  111. }
  112. /**
  113. * @param accuracy the accuracy to set
  114. */
  115. public void setAccuracy(float accuracy) {
  116. this.accuracy = accuracy;
  117. }
  118. }