org.opensha.commons.data.siteData.util
Class SiteDataTypeParameterNameMap

java.lang.Object
  extended by org.opensha.commons.util.NtoNMap<String,String>
      extended by org.opensha.commons.data.siteData.util.SiteDataTypeParameterNameMap

public class SiteDataTypeParameterNameMap
extends NtoNMap<String,String>

This class represents an N to N mapping between site data types and parameter names. If a mapping exists, then the given parameter can be set by the given site data type.

Author:
Kevin Milner

Constructor Summary
SiteDataTypeParameterNameMap()
           
 
Method Summary
 void addMapping(String type, String paramName)
          Add a mapping
 Collection<String> getParameterNamesForType(String type)
          Returns a list of all of the parameter names that can be set from this site data type
 Collection<String> getTypesForParameterName(String paramName)
          Returns a list of all site data types that can set this parameter
 boolean isTypeApplicable(SiteDataValue<?> value, Collection<ScalarIMR> imrs)
          Returns true if the given IMR/Tectonic Region mapping has a parameter that can be set by this type.
 boolean isTypeApplicable(SiteDataValue<?> value, ScalarIMR attenRel)
          Returns true if the given attenuation relationship has a parameter that can be set by this type.
 boolean isTypeApplicable(String type, Collection<? extends ScalarIMR> imrs)
          Returns true if the given IMR/Tectonic Region mapping has a parameter that can be set by this type.
 boolean isTypeApplicable(String type, ScalarIMR attenRel)
          Returns true if the given attenuation relationship has a parameter that can be set by this type.
 boolean isValidMapping(SiteDataValue<?> value, String paramName)
          Returns true if the specified mapping exists
 boolean isValidMapping(String type, String paramName)
          Returns true if the specified mapping exists
static void main(String[] args)
           
 
Methods inherited from class org.opensha.commons.util.NtoNMap
clear, containsMapping, getLefts, getLefts, getRights, getRights, isEmpty, put, putAll, remove, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteDataTypeParameterNameMap

public SiteDataTypeParameterNameMap()
Method Detail

addMapping

public void addMapping(String type,
                       String paramName)
Add a mapping

Parameters:
type -
paramName -

getTypesForParameterName

public Collection<String> getTypesForParameterName(String paramName)
Returns a list of all site data types that can set this parameter

Parameters:
paramName -
Returns:

getParameterNamesForType

public Collection<String> getParameterNamesForType(String type)
Returns a list of all of the parameter names that can be set from this site data type

Parameters:
type -
Returns:

isValidMapping

public boolean isValidMapping(String type,
                              String paramName)
Returns true if the specified mapping exists

Parameters:
type -
paramName -
Returns:

isValidMapping

public boolean isValidMapping(SiteDataValue<?> value,
                              String paramName)
Returns true if the specified mapping exists

Parameters:
type -
paramName -
Returns:

isTypeApplicable

public boolean isTypeApplicable(String type,
                                ScalarIMR attenRel)
Returns true if the given attenuation relationship has a parameter that can be set by this type.

Parameters:
type -
attenRel -
Returns:

isTypeApplicable

public boolean isTypeApplicable(String type,
                                Collection<? extends ScalarIMR> imrs)
Returns true if the given IMR/Tectonic Region mapping has a parameter that can be set by this type.

Parameters:
type -
imrMap -
Returns:

isTypeApplicable

public boolean isTypeApplicable(SiteDataValue<?> value,
                                ScalarIMR attenRel)
Returns true if the given attenuation relationship has a parameter that can be set by this type.

Parameters:
type -
attenRel -
Returns:

isTypeApplicable

public boolean isTypeApplicable(SiteDataValue<?> value,
                                Collection<ScalarIMR> imrs)
Returns true if the given IMR/Tectonic Region mapping has a parameter that can be set by this type.

Parameters:
type -
imrMap -
Returns:

main

public static void main(String[] args)