sbrt.shell.text
Class ColonMapFormatV1<K,V>

java.lang.Object
  extended by sbrt.shell.text.AbstractMapFormat<K,V>
      extended by sbrt.shell.text.ColonMapFormatV1<K,V>
Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
Format, MapFormat<K,V>

public final class ColonMapFormatV1<K,V>
extends AbstractMapFormat<K,V>

This class is a concrete implementation of MapFormat. The string representation of map entries is:

key: value.

Instances of this class are immutable.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
ColonMapFormatV1(SimpleFormat<K> keyFormat, SimpleFormat<V> valueFormat)
          Constructs a new map format using the provided key and value formats.
 
Method Summary
static ColonMapFormatV1<java.lang.String,java.lang.String> getBasic()
          Returns a ColonMapFormatV1 that does not format or parse the keys or values supplied to it.
 PipeListFormat<V> getListFormat()
          Returns the format used for lists of values.
 ColonMapEntryFormatV1<java.lang.String,java.lang.String> getMapEntryFormat()
          Returns the format used for variable-value pairs.
 PipeSetFormat<K> getSetFormat()
          Returns the format used for sets of variables.
 
Methods inherited from class sbrt.shell.text.AbstractMapFormat
formatKey, formatKeys, formatPair, formatPair, formatValue, formatValues, formatValues, getKeyFormatter, getKeyParser, getValueFormatter, getValueParser, parseAllKeys, parseAllPairs, parseAllValues, parseAllValues, parseKey, parsePair, parseValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColonMapFormatV1

public ColonMapFormatV1(SimpleFormat<K> keyFormat,
                        SimpleFormat<V> valueFormat)
Constructs a new map format using the provided key and value formats.

Parameters:
keyFormat - the format to use for keys.
valueFormat - the format to use for values.
Throws:
java.lang.NullPointerException - if either argument is null.
Method Detail

getBasic

public static final ColonMapFormatV1<java.lang.String,java.lang.String> getBasic()
Returns a ColonMapFormatV1 that does not format or parse the keys or values supplied to it. In other words, it returns a ColonMapFormatV1 with the most basic possible functionality. Empty strings are not allowed however.

Returns:
a ColonMapFormatV1 that does not format or parse the keys and values supplied to it.

getMapEntryFormat

public ColonMapEntryFormatV1<java.lang.String,java.lang.String> getMapEntryFormat()
Returns the format used for variable-value pairs.

Specified by:
getMapEntryFormat in class AbstractMapFormat<K,V>
Returns:
the format used for variable-value pairs.

getSetFormat

public PipeSetFormat<K> getSetFormat()
Returns the format used for sets of variables.

Specified by:
getSetFormat in class AbstractMapFormat<K,V>
Returns:
the format used for sets of variables.

getListFormat

public PipeListFormat<V> getListFormat()
Returns the format used for lists of values.

Specified by:
getListFormat in class AbstractMapFormat<K,V>
Returns:
the format used for lists of values.