faa.tg.util
Class MethodMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<java.lang.String,MethodSpec>
              extended by faa.tg.util.MethodMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,MethodSpec>
Direct Known Subclasses:
NamedMethodMap

public class MethodMap
extends java.util.LinkedHashMap<java.lang.String,MethodSpec>

 MethodMap is a Map structure meant specifically to hold fieldNames
 and their MethodSpecs.  This will be used by delimwritables to specify
 their fields, methods, and units.
 
See the source: MethodMap.java

Version:
$Id: MethodMap.java,v 3.5 2008/12/30 21:46:05 danaw Exp $
Author:
Bethany Leffler, Titan/SRC, Web Apr 23 2003, Dana Whicker
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
static java.lang.String DATALINE_PREFIX_PROP
          The property key for accessing the data line prefix.
static java.lang.String DELIM_PROP
          The property key for accessing the field delimiter.
static java.lang.String HEADER_PREFIX_PROP
          The property key for accessing the header prefix.
private  MethodSpec nameSpec
          Convenience method allowing easy access to a MethodSpec that returns getName(), if that method specification was added to this MethodMap.
(package private) static long serialVersionUID
           
private  MethodSpecSelectable[] typeList
          This field allows the owner of this MethodMap to provide a selection set of the ListSelectable fields: this value remains null unless setTypeList() is called specifying an array of MethodSpecSelectable objects containing the selectable MethodSpec objects from this map.
 
Constructor Summary
MethodMap()
          Constructs an empty MethodMap.
 
Method Summary
 MethodSpec get(java.lang.String key)
          Returns the MethodSpec mapped to the specified key.
 java.lang.String getData(java.lang.Object evt, java.util.Properties props, char delimiter, StereoMapProjection smp)
          Returns the data text of this MethodMap based on the specified event.
 java.lang.String getHeader(java.util.Properties props)
          Returns the header text of this MethodMap.
 MethodSpec getNameSpec()
          Returns the MethodSpec for the getName method, if added to this map, or null if it was not added.
 java.lang.String getOutputFileName(java.lang.String outputFileTemplate, DelimWritable evt)
          Returns the output filename based on the specified template.
 MethodSpecSelectable[] getTypeList()
          Returns the selectable values of the MethodMap as a ListSelectable array; this must have been set by setTypeList() if this is to be used.
 MethodSpec put(java.lang.String key, MethodSpec method)
          Adds the MethodSpec from the list to the map.
 void setTypeList(MethodSpecSelectable[] typeList)
          Set the selectable values of the MethodMap as a ListSelectable array.
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

DELIM_PROP

public static final java.lang.String DELIM_PROP
The property key for accessing the field delimiter.

See Also:
Constant Field Values

HEADER_PREFIX_PROP

public static final java.lang.String HEADER_PREFIX_PROP
The property key for accessing the header prefix.

See Also:
Constant Field Values

DATALINE_PREFIX_PROP

public static final java.lang.String DATALINE_PREFIX_PROP
The property key for accessing the data line prefix.

See Also:
Constant Field Values

nameSpec

private MethodSpec nameSpec
Convenience method allowing easy access to a MethodSpec that returns getName(), if that method specification was added to this MethodMap.


typeList

private MethodSpecSelectable[] typeList
This field allows the owner of this MethodMap to provide a selection set of the ListSelectable fields: this value remains null unless setTypeList() is called specifying an array of MethodSpecSelectable objects containing the selectable MethodSpec objects from this map.

Constructor Detail

MethodMap

public MethodMap()
Constructs an empty MethodMap.

Method Detail

getNameSpec

public MethodSpec getNameSpec()
Returns the MethodSpec for the getName method, if added to this map, or null if it was not added.

Returns:
MethodSpec for the getName method, or null if not added.

get

public MethodSpec get(java.lang.String key)
Returns the MethodSpec mapped to the specified key.

Parameters:
key - The key (title/description) to get the desired method result.
Returns:
MethodSpec for the key specified

put

public MethodSpec put(java.lang.String key,
                      MethodSpec method)
Adds the MethodSpec from the list to the map. If the MethodSpec calls getName(), the name variable will be set.

Specified by:
put in interface java.util.Map<java.lang.String,MethodSpec>
Overrides:
put in class java.util.HashMap<java.lang.String,MethodSpec>
Parameters:
key - The unique title/description for the method result.
method - The MethodSpec that calls the desired method.
Returns:
Returns the previous MethodSpec for the key if there was one.

getTypeList

public MethodSpecSelectable[] getTypeList()
Returns the selectable values of the MethodMap as a ListSelectable array; this must have been set by setTypeList() if this is to be used.


setTypeList

public void setTypeList(MethodSpecSelectable[] typeList)
Set the selectable values of the MethodMap as a ListSelectable array.


getHeader

public java.lang.String getHeader(java.util.Properties props)
Returns the header text of this MethodMap.

Parameters:
props - Properties that modify the header text.

getData

public java.lang.String getData(java.lang.Object evt,
                                java.util.Properties props,
                                char delimiter,
                                StereoMapProjection smp)
Returns the data text of this MethodMap based on the specified event.

Parameters:
evt - The event to use to get the field data.
props - Properties that modify the data text.
delimiter -
smp - Null, or a stereographic projection if the lat/longs should be converted to xy-coordinates.

getOutputFileName

public java.lang.String getOutputFileName(java.lang.String outputFileTemplate,
                                          DelimWritable evt)
Returns the output filename based on the specified template.

Subclasses overriding this method should replace any "*" in the template string with the event's class name.

Parameters:
outputFileTemplate - Base output filename template as a String.
evt - The DelimWritable event to be written to the output file.