com.isti.quakewatch.util
Class ResourceIdentifier

java.lang.Object
  extended by com.isti.quakewatch.util.ResourceIdentifier

public class ResourceIdentifier
extends java.lang.Object

Class ResourceIdentifier defines a resource identifier parsed from a URI string, as defined in the QuakeML specification. The URI format is: smi:(authority-id)/(resource-id)[#(local-id)] The "local-id" is subdivided into "typ_SS_code", where 'typ' is the resource-type code (i.e., "evt", "prd", "mag"), 'SS' is the data-source specified, and 'code' is an optional product code. Examples: smi:local/00688138#evt_AT smi:local/00688138#prd_AT_Tsunami smi:local/00688138#mag_AT_Ml


Field Summary
protected  int authorityIDPos
           
protected  int dataSourcePos
           
protected  boolean productCodeFlag
           
protected  int resourceIDPos
           
protected  int resourceTypePos
           
static java.lang.String SMI_PRE_STR
          Schema name "smi" string.
static int SMI_STR_LEN
          Length of schema name "smi" string.
protected  java.lang.String sourceURIStr
           
 
Constructor Summary
ResourceIdentifier(java.lang.String sourceURIStr)
          Creates a resource identifier parsed from the given URI string.
 
Method Summary
 java.lang.String getAuthorityIDStr()
          Returns the 'authority-id' string.
 java.lang.String getDataSourceStr()
          Returns the 'data-source' ('SS') string.
 java.lang.String getLocalIDStr()
          Returns the 'local-id' string.
 java.lang.String getProductCodeStr()
          Returns the 'product-code' ('code') string.
 java.lang.String getResourceIDStr()
          Returns the 'resource-id' string.
 java.lang.String getResourceTypeStr()
          Returns the 'resource-type' ('typ') string.
 java.lang.String getSourceURIStr()
          Returns the source URI string used to create this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceURIStr

protected final java.lang.String sourceURIStr

authorityIDPos

protected final int authorityIDPos

resourceIDPos

protected final int resourceIDPos

resourceTypePos

protected final int resourceTypePos

dataSourcePos

protected final int dataSourcePos

productCodeFlag

protected final boolean productCodeFlag

SMI_PRE_STR

public static final java.lang.String SMI_PRE_STR
Schema name "smi" string.

See Also:
Constant Field Values

SMI_STR_LEN

public static final int SMI_STR_LEN
Length of schema name "smi" string.

Constructor Detail

ResourceIdentifier

public ResourceIdentifier(java.lang.String sourceURIStr)
Creates a resource identifier parsed from the given URI string.

Parameters:
sourceURIStr - source URI string.
Method Detail

getSourceURIStr

public java.lang.String getSourceURIStr()
Returns the source URI string used to create this object.

Returns:
The source URI string used to create this object.

getAuthorityIDStr

public java.lang.String getAuthorityIDStr()
Returns the 'authority-id' string.

Returns:
A new string containing the 'authority-id' value, or null if not available.

getResourceIDStr

public java.lang.String getResourceIDStr()
Returns the 'resource-id' string.

Returns:
A new string containing the 'resource-id' value, or null if not available.

getLocalIDStr

public java.lang.String getLocalIDStr()
Returns the 'local-id' string.

Returns:
A new string containing the 'local-id' value, or null if not available.

getResourceTypeStr

public java.lang.String getResourceTypeStr()
Returns the 'resource-type' ('typ') string.

Returns:
A new string containing the 'resource-type' value, or null if not available.

getDataSourceStr

public java.lang.String getDataSourceStr()
Returns the 'data-source' ('SS') string.

Returns:
A new string containing the 'data-source' value, or null if not available.

getProductCodeStr

public java.lang.String getProductCodeStr()
Returns the 'product-code' ('code') string.

Returns:
A new string containing the 'product-code' value, or null if not available.