net.degreedays.api.data.impl
Class StationIdLocation

java.lang.Object
  extended by net.degreedays.api.data.Location
      extended by net.degreedays.api.data.impl.StationIdLocation
All Implemented Interfaces:
java.io.Serializable

public final class StationIdLocation
extends Location
implements java.io.Serializable

Specifies a location in terms of a weather station ID (you can find these IDs through the website at www.degreedays.net or by requesting data from geographic locations).

Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.


Constructor Summary
StationIdLocation(java.lang.String stationId)
          Constructs a StationIdLocation object with the specified weather station ID.
 
Method Summary
 java.lang.String stationId()
          Returns the non-null, non-empty string ID of the weather station that this StationIdLocation represents.
 java.lang.String toString()
          Returns a non-null, non-empty string representation of this object for logging and debugging purposes.
 
Methods inherited from class net.degreedays.api.data.Location
equals, hashCode, longLat, postalCode, stationId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StationIdLocation

public StationIdLocation(java.lang.String stationId)
                  throws java.lang.IllegalArgumentException
Constructs a StationIdLocation object with the specified weather station ID.

Parameters:
stationId - the non-null, non-empty ID of the weather station that the StationIdLocation should represent (i.e. the station you want data for). Cannot contain contain any characters other than [-_0-9a-zA-Z], and cannot contain more than 60 characters (a limit that is significantly larger than the length of any station ID that we are currently aware of, but that is set high to allow for "virtual station IDs" to be introduced in the future, combining data from multiple stations).
Throws:
java.lang.NullPointerException - if stationId is null.
java.lang.IllegalArgumentException - if tests indicate that stationId fails to match the specification detailed above.
Method Detail

stationId

public java.lang.String stationId()
Returns the non-null, non-empty string ID of the weather station that this StationIdLocation represents.


toString

public java.lang.String toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.

The exact details of the representation are unspecified and subject to change.

Overrides:
toString in class java.lang.Object


www.degreedays.net/api/