ps4
Enum StreetClassification

java.lang.Object
  extended by java.lang.Enum<StreetClassification>
      extended by ps4.StreetClassification
All Implemented Interfaces:
Serializable, Comparable<StreetClassification>

public enum StreetClassification
extends Enum<StreetClassification>

A StreetClassification describes a street category. It is an enumeration type, which you can tell by the class declaration public enum StreetClassification. There are a handful of values the type may hold, and the set of options is fixed at compile time.

Example uses:

 StreetClassification myType = StreetClassification.LOCAL_ROAD;
 // ...
 if (myType == StreetClassification.UNKNOWN) {
      // ...
 }
 

Notice that you may reference the constant values as you would with any other static variable, e.g. ClassName.STATIC_FIELD_NAME. Also, you may use the == operator to check for equality, since there is only one copy of each object.

The ordering given by the compareTo method of this class is consistent with equals, and gives the following ordering: PRIM_HWY, SEC_HWY, LOCAL_ROAD, UNKNOWN.


Enum Constant Summary
LOCAL_ROAD
          Classification indicating a local road.
PRIM_HWY
          Classification indicating a primary highway.
SEC_HWY
          Classification indicating a secondary highway.
UNKNOWN
          Classification indicating an unknown type of street.
 
Method Summary
static StreetClassification parse(String in)
           
 String toString()
           
 String unparse()
          Returns a concise, parseable string representation.
static StreetClassification valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StreetClassification[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PRIM_HWY

public static final StreetClassification PRIM_HWY
Classification indicating a primary highway. Primary highways include interstate highways and some toll highways; these highways are accesed by way of ramps and have multiple lanes of traffic.


SEC_HWY

public static final StreetClassification SEC_HWY
Classification indicating a secondary highway. Secondary highways include state highways and some county highways.


LOCAL_ROAD

public static final StreetClassification LOCAL_ROAD
Classification indicating a local road. Local roads are for local traffic. Scenic park roads and unpaved roads are also included in this category.


UNKNOWN

public static final StreetClassification UNKNOWN
Classification indicating an unknown type of street. This classificiation is given to streets that do not fall within one of the other three categories or to streets for which not enough information is known to classify them.

Method Detail

values

public static StreetClassification[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (StreetClassification c : StreetClassification.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static StreetClassification valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<StreetClassification>
Returns:
a String representation of this

parse

public static StreetClassification parse(String in)
Parameters:
in - the enum constant name or human-friendly name
Returns:
a StreetClassification that matches the string passed in

unparse

public String unparse()
Returns a concise, parseable string representation.