Interface Stop

All Superinterfaces:
Encodable
All Known Implementing Classes:
Stop.Other, Stop.Tram, Stop.Urban

public sealed interface Stop extends Encodable permits Stop.Urban, Stop.Tram, Stop.Other
Where a transaction happened, bytes 5 and 6 of a transaction. Bit 15 marks an urban bus stop; without it the value is a tram stop on the tram route and an id of another operator elsewhere.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A stop of an operator other than the urban buses and the tram.
    static final record 
    A tram stop, whose number the card stores multiplied by one hundred.
    static final record 
    An urban bus stop, which the operator numbers internally.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Bytes a stop takes.
    static final int
    Largest id the fifteen free bits hold.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static Stop
    decode(byte[] bytes, Route route)
    Decodes bytes 5 and 6 of a transaction.

    Methods inherited from interface dev.hloth.zgztransport.Encodable

    encode
  • Field Details

  • Method Details

    • decode

      static Stop decode(byte[] bytes, Route route)
      Decodes bytes 5 and 6 of a transaction.
      Parameters:
      bytes - the two bytes
      route - the route of the same transaction, which tells the tram from other operators
      Returns:
      the stop
      Throws:
      CardFormatException - if the input is not two bytes