StopSuggestion.kt 902 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package ml.adamsprogs.bimba.models.suggestions
  2. import android.content.Context
  3. import ml.adamsprogs.bimba.R
  4. class StopSuggestion(name: String, val zone: String) : GtfsSuggestion(name) {
  5. override fun getBody(context: Context): String {
  6. return name
  7. }
  8. override fun getIcon(): Int {
  9. return R.drawable.ic_stop
  10. }
  11. override fun getColour(): Int {
  12. return 0xffffff
  13. }
  14. override fun getBgColour(): Int {
  15. return 0x000000
  16. }
  17. override fun compareTo(other: GtfsSuggestion): Int {
  18. return name.compareTo(other.name)
  19. }
  20. override fun equals(other: Any?): Boolean {
  21. if (other == null || other !is GtfsSuggestion)
  22. return false
  23. return name == other.name
  24. }
  25. override fun hashCode(): Int {
  26. var result = zone.hashCode()
  27. result = 31 * result + name.hashCode()
  28. return result
  29. }
  30. }