org.onebusaway.gtfs.model
Class AgencyAndId

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

public class AgencyAndId
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<AgencyAndId>

See Also:
Serialized Form

Field Summary
static char ID_SEPARATOR
           
 
Constructor Summary
AgencyAndId()
           
AgencyAndId(java.lang.String agencyId, java.lang.String id)
           
 
Method Summary
 int compareTo(AgencyAndId o)
           
static AgencyAndId convertFromString(java.lang.String value)
          Given an id of the form "agencyId_entityId", parses into a AgencyAndId id object.
static AgencyAndId convertFromString(java.lang.String value, char separator)
          Given an id of the form "agencyId_entityId", parses into a AgencyAndId id object.
static java.lang.String convertToString(AgencyAndId aid)
          Given an AgencyAndId object, creates a string representation of the form "agencyId_entityId"
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAgencyId()
           
 java.lang.String getId()
           
 int hashCode()
           
 boolean hasValues()
           
 void setAgencyId(java.lang.String agencyId)
           
 void setId(java.lang.String id)
           
 java.lang.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(java.lang.String agencyId,
                   java.lang.String id)
Method Detail

getAgencyId

public java.lang.String getAgencyId()

setAgencyId

public void setAgencyId(java.lang.String agencyId)

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

hasValues

public boolean hasValues()

compareTo

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

convertFromString

public static AgencyAndId convertFromString(java.lang.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 java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

convertFromString

public static AgencyAndId convertFromString(java.lang.String value)
                                     throws java.lang.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:
java.lang.IllegalArgumentException

convertToString

public static java.lang.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 © 2011 OneBusAway. All Rights Reserved.