org.onebusaway.gtfs.model
Class AgencyAndId

java.lang.Object
  extended by org.onebusaway.gtfs.model.AgencyAndId
All Implemented Interfaces:
Serializable, Comparable<AgencyAndId>

public class AgencyAndId
extends Object
implements Serializable, Comparable<AgencyAndId>

See Also:
Serialized Form

Field Summary
static char ID_SEPARATOR
           
 
Constructor Summary
AgencyAndId()
           
AgencyAndId(String agencyId, String id)
           
 
Method Summary
 int compareTo(AgencyAndId o)
           
static AgencyAndId convertFromString(String value)
          Given an id of the form "agencyId_entityId", parses into a AgencyAndId id object.
static AgencyAndId convertFromString(String value, char separator)
          Given an id of the form "agencyId_entityId", parses into a AgencyAndId id object.
static String convertToString(AgencyAndId aid)
          Given an AgencyAndId object, creates a string representation of the form "agencyId_entityId"
 boolean equals(Object obj)
           
 String getAgencyId()
           
 String getId()
           
 int hashCode()
           
 boolean hasValues()
           
 void setAgencyId(String agencyId)
           
 void setId(String id)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_SEPARATOR

public static final char ID_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

AgencyAndId

public AgencyAndId()

AgencyAndId

public AgencyAndId(String agencyId,
                   String id)
Method Detail

getAgencyId

public String getAgencyId()

setAgencyId

public void setAgencyId(String agencyId)

getId

public String getId()

setId

public void setId(String id)

hasValues

public boolean hasValues()

compareTo

public int compareTo(AgencyAndId o)
Specified by:
compareTo in interface Comparable<AgencyAndId>

convertFromString

public static AgencyAndId convertFromString(String value,
                                            char separator)
Given an id of the form "agencyId_entityId", parses into a AgencyAndId id object.

Parameters:
value - id of the form "agencyId_entityId"
Returns:
an id object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

convertFromString

public static AgencyAndId convertFromString(String value)
                                     throws IllegalArgumentException
Given an id of the form "agencyId_entityId", parses into a AgencyAndId id object.

Parameters:
value - id of the form "agencyId_entityId"
Returns:
an id object
Throws:
IllegalArgumentException - if the id cannot be parsed

convertToString

public static String convertToString(AgencyAndId aid)
Given an AgencyAndId object, creates a string representation of the form "agencyId_entityId"

Parameters:
aid - an id object
Returns:
a string representation of the form "agencyId_entityId"


Copyright © 2012 OneBusAway. All Rights Reserved.