com.askgeo.dbl.base
Enum FieldUnit

java.lang.Object
  extended by java.lang.Enum<FieldUnit>
      extended by com.askgeo.dbl.base.FieldUnit
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FieldUnit>

public enum FieldUnit
extends java.lang.Enum<FieldUnit>

The various map classes return result classes when queried that contain metadata about the queried shape. The metadata fields that are returned by a given map class are enumerated in one or more enums that implement the DataFieldInterface. That interface includes an accessor that returns the FieldUnit of the field in question. The unit is a logical unit, such as "people", "dollars", and "percent".

This class enumerates the units used by the various AskGeo maps. All units are annotated with a human readable name (e.g, "kilometers" or "degrees"), and type (as specified by providing a FieldType e.g., FieldType.STRING or FieldType.FLOAT).


Enum Constant Summary
DEGREES
          Angular degrees, as in the latitude or longitude of a location.
DOLLARS
          US dollars, mostly in 2010 terms.
GINI_INDEX
          The Gini index of income inequality.
HOUSEHOLDS
          A household is a group of people living together.
HOUSING_UNITS
          A housing unit is one apartment, house, etc., that contains one household.
KILOMETERS
          Kilometers of distance, in our case reporting how far from a query point to the shape it was matched with.
MILLION_DOLLARS
          Millions of US dollars, mostly in 2010 terms.
MILLISECONDS
          Milliseconds, in our case describing the offset between UTC and local time for a given time zone.
NONE_BOOLEAN
          Unitless but of type boolean.
NONE_INTEGER
          Unitless but of type int.
NONE_STRING
          Unitless but of type String.
PEOPLE
          A count of the number of people in some category.
PEOPLE_PER_SQUARE_MILE
          Number of people per square mile, as reported by the US Census for various statistical and political areas.
PERCENT
          A percentage, as in the percentage of people in a category as a percentage of all people.
ROOMS
          The number of rooms in a housing unit.
SQUARE_METERS
          Square meters of area, as for example with a state or county.
SQUARE_MILES
          Square miles of area, as for example with a state or county.
YEARS
          Typically this is used to report ages of people.
 
Method Summary
 FieldType fieldType()
          Returns the FieldType corresponding to this FieldUnit.
 java.lang.String readableName()
          Returns a human readable name for the unit (e.g, "kilometers" or "degrees").
static FieldUnit valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FieldUnit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE_STRING

public static final FieldUnit NONE_STRING
Unitless but of type String.


NONE_INTEGER

public static final FieldUnit NONE_INTEGER
Unitless but of type int.


NONE_BOOLEAN

public static final FieldUnit NONE_BOOLEAN
Unitless but of type boolean.


PEOPLE

public static final FieldUnit PEOPLE
A count of the number of people in some category.


PERCENT

public static final FieldUnit PERCENT
A percentage, as in the percentage of people in a category as a percentage of all people.


DOLLARS

public static final FieldUnit DOLLARS
US dollars, mostly in 2010 terms.


MILLION_DOLLARS

public static final FieldUnit MILLION_DOLLARS
Millions of US dollars, mostly in 2010 terms.


HOUSING_UNITS

public static final FieldUnit HOUSING_UNITS
A housing unit is one apartment, house, etc., that contains one household.


HOUSEHOLDS

public static final FieldUnit HOUSEHOLDS
A household is a group of people living together. Please look up the official US Census definition for more details.


YEARS

public static final FieldUnit YEARS
Typically this is used to report ages of people.


ROOMS

public static final FieldUnit ROOMS
The number of rooms in a housing unit.


GINI_INDEX

public static final FieldUnit GINI_INDEX
The Gini index of income inequality. Look up the wikipedia page on the topic for more details.


DEGREES

public static final FieldUnit DEGREES
Angular degrees, as in the latitude or longitude of a location.


MILLISECONDS

public static final FieldUnit MILLISECONDS
Milliseconds, in our case describing the offset between UTC and local time for a given time zone.


KILOMETERS

public static final FieldUnit KILOMETERS
Kilometers of distance, in our case reporting how far from a query point to the shape it was matched with.


PEOPLE_PER_SQUARE_MILE

public static final FieldUnit PEOPLE_PER_SQUARE_MILE
Number of people per square mile, as reported by the US Census for various statistical and political areas.


SQUARE_MILES

public static final FieldUnit SQUARE_MILES
Square miles of area, as for example with a state or county.


SQUARE_METERS

public static final FieldUnit SQUARE_METERS
Square meters of area, as for example with a state or county.

Method Detail

values

public static FieldUnit[] 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 (FieldUnit c : FieldUnit.values())
    System.out.println(c);

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

valueOf

public static FieldUnit valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

fieldType

public FieldType fieldType()
Returns the FieldType corresponding to this FieldUnit. Most units are represented by the FieldType.FLOAT type, but fields with no unit (such as a code, or a boolean variable) are of FieldType.STRING, FieldType.BOOLEAN, or FieldType.INTEGER.

Returns:
the FieldType of a this FieldUnit.

readableName

public java.lang.String readableName()
Returns a human readable name for the unit (e.g, "kilometers" or "degrees").

Returns:
a human readable String representation of this FieldUnit.


Copyright © 2012 Vector Magic, Inc.