NetworkRecord.java 2.9 KB

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