org.opensha.commons.eq.cat.util
Enum EventType

java.lang.Object
  extended by java.lang.Enum<EventType>
      extended by org.opensha.commons.eq.cat.util.EventType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<EventType>

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

Values for different earthquake event types.

Version:
$Id: EventType.java 7478 2011-02-15 04:56:25Z pmpowers $
Author:
Peter Powers

Enum Constant Summary
LOCAL
          Local event value.
NUCLEAR
          Nuclear blast event value.
QUARRY
          Quarry blast event value.
REGIONAL
          Regional event value.
SONIC
          Sonic boom event value.
TELESEISM
          Teleseismic event value.
UNKNOWN
          Unknown event type value.
 
Method Summary
 java.lang.String abbr()
          Returns the abbreviation commonly used to identify this EventType (in earthquake catalogs).
 int id()
          Returns the id value for this EventType.
static EventType parse(java.lang.String s)
          Convert a string to an EventType.
 EventType typeForID(int id)
          Returns the EventType corresponding to the supplied id value, or null if no EventType with the supplied id exists.
static EventType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static EventType[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNKNOWN

public static final EventType UNKNOWN
Unknown event type value.


LOCAL

public static final EventType LOCAL
Local event value.


REGIONAL

public static final EventType REGIONAL
Regional event value.


TELESEISM

public static final EventType TELESEISM
Teleseismic event value.


QUARRY

public static final EventType QUARRY
Quarry blast event value.


SONIC

public static final EventType SONIC
Sonic boom event value.


NUCLEAR

public static final EventType NUCLEAR
Nuclear blast event value.

Method Detail

values

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

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

valueOf

public static EventType 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

typeForID

public EventType typeForID(int id)
Returns the EventType corresponding to the supplied id value, or null if no EventType with the supplied id exists.

Parameters:
id - to look up
Returns:
the EventType

id

public int id()
Returns the id value for this EventType. The id is used when storing (persisting) this value.

Returns:
the EventType id

abbr

public java.lang.String abbr()
Returns the abbreviation commonly used to identify this EventType (in earthquake catalogs).

Returns:
the abbreviation for this EventType

parse

public static EventType parse(java.lang.String s)
Convert a string to an EventType. If the string does not match any value, EventType.UNKNOWN is returned. This method is case insensitive.

Parameters:
s - string to convert
Returns:
the EventType value