|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.text.AbstractMapFormat<K,V>
K
- the key type.V
- the value type.public abstract class AbstractMapFormat<K,V>
This abstract class is a skeleton implementation of MapFormat.
Constructor Summary | |
---|---|
AbstractMapFormat()
|
Method Summary | ||
---|---|---|
|
formatKey(S key)
Returns a formatted string representation of the provided key. |
|
java.lang.String |
formatKeys(java.util.Set<? extends K> keys)
Returns a formatted string representation of the provided set of keys. |
|
java.lang.String |
formatPair(java.util.Map.Entry<? extends K,? extends V> entry)
Returns a formatted string representation of the provided map entry. |
|
|
formatPair(S key,
T value)
Returns a string representation of the provided key-value pair. |
|
|
formatValue(T value)
Returns a formatted string representation of the provided value. |
|
java.lang.String |
formatValues(java.util.List<? extends V> values)
Returns a string representation of the provided list of values. |
|
java.lang.String |
formatValues(java.util.Map<? extends K,? extends V> map)
Returns a string representation of the values in the provided map formatted as a list. |
|
Formatter<K> |
getKeyFormatter()
Returns the formatter used for keys. |
|
Parser<K> |
getKeyParser()
Returns the parser used for keys. |
|
abstract ListFormat<V> |
getListFormat()
Returns the format used for lists of values. |
|
abstract MapEntryFormat<java.lang.String,java.lang.String> |
getMapEntryFormat()
Returns the format used for variable-value pairs. |
|
abstract LinkedHashSetFormat<K> |
getSetFormat()
Returns the format used for sets of keys. |
|
Formatter<V> |
getValueFormatter()
Returns the formatter used for values. |
|
Parser<V> |
getValueParser()
Returns the parser used for values. |
|
java.util.LinkedHashSet<K> |
parseAllKeys(java.lang.String allKeys)
Parses the provided string and returns its corresponding set of keys. |
|
java.util.Map<K,V> |
parseAllPairs(java.lang.String allkeys,
java.lang.String allValues)
Parses the provided set of keys and list of values and returns a corresponding map of variable-value pairs. |
|
java.util.Map<K,V> |
parseAllValues(java.util.LinkedHashSet<? extends K> allkeys,
java.lang.String allValues)
Parses the provided string of values and returns a corresponding map of variable-value pairs using the provided set of keys. |
|
java.util.List<V> |
parseAllValues(java.lang.String allValues)
Parses the provided string and returns its corresponding list of values. |
|
K |
parseKey(java.lang.String key)
Parses the provided string and returns its corresponding key. |
|
java.util.Map.Entry<K,V> |
parsePair(java.lang.String mapEntry)
Parses the provided map entry string, and returns its corresponding map entry. |
|
V |
parseValue(java.lang.String value)
Parses the provided string and returns its corresponding value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMapFormat()
Method Detail |
---|
public Formatter<K> getKeyFormatter()
public Parser<K> getKeyParser()
public Formatter<V> getValueFormatter()
public Parser<V> getValueParser()
public abstract MapEntryFormat<java.lang.String,java.lang.String> getMapEntryFormat()
public abstract LinkedHashSetFormat<K> getSetFormat()
public abstract ListFormat<V> getListFormat()
public <S extends K> java.lang.String formatKey(S key)
formatKey
in interface MapFormat<K,V>
S
- a type that extends the primary key
type of this format.key
- the key to be formatted.
public <T extends V> java.lang.String formatValue(T value)
formatValue
in interface MapFormat<K,V>
T
- a type that extends the primary value
type of this format.value
- the value to be formatted.
public java.lang.String formatKeys(java.util.Set<? extends K> keys)
formatKeys
in interface MapFormat<K,V>
keys
- the set of keys to be formatted.
public java.lang.String formatValues(java.util.List<? extends V> values)
formatValues
in interface MapFormat<K,V>
values
- the list of values to be formatted.
public java.lang.String formatValues(java.util.Map<? extends K,? extends V> map)
java.util.Map
for further details.
formatValues
in interface MapFormat<K,V>
map
- keys mapped to their respective values.
public <S extends K,T extends V> java.lang.String formatPair(S key, T value)
formatPair
in interface MapFormat<K,V>
S
- a type extending the primary key type.T
- a type extending the primary value type.key
- the key.value
- the value.
public java.lang.String formatPair(java.util.Map.Entry<? extends K,? extends V> entry)
formatPair
in interface MapFormat<K,V>
entry
- the map entry.
public K parseKey(java.lang.String key)
parseKey
in interface MapFormat<K,V>
key
- a string representation of a key.
public V parseValue(java.lang.String value)
parseValue
in interface MapFormat<K,V>
value
- a string representation of a value.
public java.util.Map.Entry<K,V> parsePair(java.lang.String mapEntry)
parsePair
in interface MapFormat<K,V>
mapEntry
- the string representation of a
single map entry.
public java.util.LinkedHashSet<K> parseAllKeys(java.lang.String allKeys)
parseAllKeys
in interface MapFormat<K,V>
allKeys
- a string representation of a set
of keys.
public java.util.List<V> parseAllValues(java.lang.String allValues)
parseAllValues
in interface MapFormat<K,V>
allValues
- a string representation of a list
of values.
public java.util.Map<K,V> parseAllValues(java.util.LinkedHashSet<? extends K> allkeys, java.lang.String allValues)
parseAllValues
in interface MapFormat<K,V>
allkeys
- the set of keys with which
to associate the parsed values.allValues
- a string representation of a list
of values.
public java.util.Map<K,V> parseAllPairs(java.lang.String allkeys, java.lang.String allValues)
parseAllPairs
in interface MapFormat<K,V>
allkeys
- a string representation of a set
of keys.allValues
- a string representation of a list of
values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |