com.ecebs.rtd.enabler.types.itso
Class LOCE

java.lang.Object
  extended by com.ecebs.rtd.enabler.types.itso.LOCE
All Implemented Interfaces:
Serializable

public class LOCE
extends Object
implements Serializable

Represents the LOCE structure found as part of LOCx structures within ITSO IPEs.

Note on length: as per ITSO 1000-1 part 4.2.4, most LOC structures have a specific size. Where the size is variable, the LOCE structure will be wrapped by a LOC1 structure. For all other types, the length is fixed and defined in ITSO 1000-1 part 4.2.4.

Author:
kyleb
See Also:
ITSO 1000-1, 4.2.4, Serialized Form

Nested Class Summary
static class LOCE.LocDefType
          Defines the types of locations defined in ITSO 1000-1, 4.2.4
 
Field Summary
static byte LOCE_LEN
           
 
Constructor Summary
LOCE(int offset, byte[] bytes, byte locType, int length)
           
 
Method Summary
 String getAtcoCode()
          Get the atco code for a LOCE of type 211 (LOCE.LocDefType.ATCO_CODE)
 short getCountryCode()
          Get the country code for a LOCE of type 208 (LOCE.LocDefType.FULL_NLC)
 byte[] getData()
           
 LOCE.LocDefType getLocDefType()
           
 int getMachineNumber()
          Get the machine number for a LOCE of type 202 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_1)
 List<String> getMultipleNAPTANCodes()
          Get the list of NAPTAN codes for a LOCE of type 212 (LOCE.LocDefType.MULTIPLE_NAPTAN_CODES)
 String getNAPTANCode()
          Get the NAPTAN Code for a LOCE of type 206 (LOCE.LocDefType.NAPTAN_CODE)
 String getNLC()
          Get the NLC for a LOCE of type 208 (LOCE.LocDefType.FULL_NLC)
 int getOID()
          Get the operator identity for a LOCE of type 209 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_2)
 String getServiceNumber()
          Get the service number for a LOCE of type 209 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_2)
 List<String> getServiceNumbers()
          Get the list of service numbers for a LOCE of type 210 (LOCE.LocDefType.SERVICE_NUMBERS)
 short getStageNumber()
          Get the stage number for a LOCE of type 202 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_1)
 int getZonalBitmap()
          Get the Zonal bit map for a LOCE of type 204 (LOCE.LocDefType.ZONAL_BITMAP_ANYWHERE) or 205 (LOCE.LocDefType.ZONAL_BITMAP_ZONETOZONE)
 long getZoneNumber()
          Get the zone number for a LOCE of type 207 (LOCE.LocDefType.ZONE_NUMBER)
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCE_LEN

public static final byte LOCE_LEN
See Also:
Constant Field Values
Constructor Detail

LOCE

public LOCE(int offset,
            byte[] bytes,
            byte locType,
            int length)
     throws IndexOutOfBoundsException
Throws:
IndexOutOfBoundsException
Method Detail

getData

public byte[] getData()

getLocDefType

public LOCE.LocDefType getLocDefType()

toString

public String toString()
Overrides:
toString in class Object

getMachineNumber

public int getMachineNumber()
Get the machine number for a LOCE of type 202 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_1)

Returns:
The machine number
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.BUS_FARE_STAGE_TYPE_1

getStageNumber

public short getStageNumber()
Get the stage number for a LOCE of type 202 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_1)

Returns:
The stage number
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.BUS_FARE_STAGE_TYPE_1

getZonalBitmap

public int getZonalBitmap()
Get the Zonal bit map for a LOCE of type 204 (LOCE.LocDefType.ZONAL_BITMAP_ANYWHERE) or 205 (LOCE.LocDefType.ZONAL_BITMAP_ZONETOZONE)

Returns:
The bitmap
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.ZONAL_BITMAP_ANYWHERE or LOCE.LocDefType.ZONAL_BITMAP_ZONETOZONE
See Also:
ByteUtils.isBitSet(int, int)

getNAPTANCode

public String getNAPTANCode()
Get the NAPTAN Code for a LOCE of type 206 (LOCE.LocDefType.NAPTAN_CODE)

Returns:
The BCD representation of the NAPTAN code
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.NAPTAN_CODE

getZoneNumber

public long getZoneNumber()
Get the zone number for a LOCE of type 207 (LOCE.LocDefType.ZONE_NUMBER)

Returns:
The zone number
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.ZONE_NUMBER

getCountryCode

public short getCountryCode()
Get the country code for a LOCE of type 208 (LOCE.LocDefType.FULL_NLC)

Returns:
The country code
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.FULL_NLC

getNLC

public String getNLC()
Get the NLC for a LOCE of type 208 (LOCE.LocDefType.FULL_NLC)

Returns:
The BCD representation of the NAPTAN code
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.NAPTAN_CODE

getOID

public int getOID()
Get the operator identity for a LOCE of type 209 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_2)

Returns:
The OID
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.BUS_FARE_STAGE_TYPE_2

getServiceNumber

public String getServiceNumber()
Get the service number for a LOCE of type 209 (LOCE.LocDefType.BUS_FARE_STAGE_TYPE_2)

Returns:
The service number
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.BUS_FARE_STAGE_TYPE_2

getServiceNumbers

public List<String> getServiceNumbers()
Get the list of service numbers for a LOCE of type 210 (LOCE.LocDefType.SERVICE_NUMBERS)

Returns:
List of service numbers
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.SERVICE_NUMBERS

getAtcoCode

public String getAtcoCode()
Get the atco code for a LOCE of type 211 (LOCE.LocDefType.ATCO_CODE)

Returns:
ATCO code
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.ATCO_CODE

getMultipleNAPTANCodes

public List<String> getMultipleNAPTANCodes()
Get the list of NAPTAN codes for a LOCE of type 212 (LOCE.LocDefType.MULTIPLE_NAPTAN_CODES)

Returns:
List of NAPTAN codes
Throws:
IllegalStateException - thrown if the type of this LOCE instance is not LOCE.LocDefType.MULTIPLE_NAPTAN_CODES


Copyright © 2013 Ecebs Ltd. All Rights Reserved.