com.glaivestone.javax.util
Class MapX

java.lang.Object
  |
  +--com.glaivestone.javax.util.MapX

public class MapX
extends java.lang.Object

General-purpose extensions to the standard Map services.

This class provides static methods that manipulate Map values.

Author:
Deb Lewis

Method Summary
static java.util.Map createMap(java.lang.Object[][] keyValueSpecifications)
          Answer a new mapping table containing the key/value pairs in the initialization specifications.
static java.lang.Object getKey(java.lang.Object aValue, java.util.Map mappingTable)
          Answer the key which maps to the given value in the mapping table.
static void registerEntries(java.util.Map mappingTable, java.lang.Object[][] keyValueSpecifications)
          Register the key/value pairs in the specification list in the mapping table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createMap

public static java.util.Map createMap(java.lang.Object[][] keyValueSpecifications)
Answer a new mapping table containing the key/value pairs in the initialization specifications.


getKey

public static java.lang.Object getKey(java.lang.Object aValue,
                                      java.util.Map mappingTable)
Answer the key which maps to the given value in the mapping table.

Returns null if the specified value is not in the map. The result is non-deterministic if more than one key in the table maps to the value.


registerEntries

public static void registerEntries(java.util.Map mappingTable,
                                   java.lang.Object[][] keyValueSpecifications)
Register the key/value pairs in the specification list in the mapping table.

This service is a mainly a notational convenience so you can write succint initialization methods which load standard mapping tables from array literal specifications.


GFL 1.1 API